samlOrWsFedExternalDomainFederation を作成する
[アーティクル]
07/13/2022
3 人の共同作成者
この記事の内容
名前空間: microsoft.graph
重要
Microsoft Graph のバージョンの /beta API は変更される可能性があります。 実稼働アプリケーションでこれらの API を使用することは、サポートされていません。 API が v1.0 で使用できるかどうかを確認するには、 バージョン セレクターを使用します。
新しい samlOrWsFedExternalDomainFederation オブジェクトを 作成します。
アクセス許可
この API を呼び出すには、次のいずれかのアクセス許可が必要です。アクセス許可の選択方法などの詳細については、「アクセス許可 」を参照してください。
アクセス許可の種類
アクセス許可 (特権の小さいものから大きいものへ)
委任 (職場または学校のアカウント)
IdentityProvider.ReadWrite.All
委任 (個人用 Microsoft アカウント)
サポートされていません。
アプリケーション
IdentityProvider.ReadWrite.All
職場または学校アカウントは、次のいずれかのロールに属している必要があります。
HTTP 要求
POST /directory/federationConfigurations/microsoft.graph.samlOrWsFedExternalDomainFederation
名前
説明
Authorization
ベアラー {token}。必須。
Content-Type
application/json. Required.
要求本文
要求本文で、 samlOrWsFedExternalDomainFederation オブジェクトの JSON 表現を指定します。
次の表は、 samlOrWsFedExternalDomainFederation を作成するときに必要なプロパティを示しています。
プロパティ
型
説明
displayName
String
SAML/WS-Fed ベースの ID プロバイダーの表示名。 identityProviderBase から継承されます。
issuerUri
String
フェデレーション サーバーの発行者 URI。 samlOrWsFedProvider から継承されます。
metadataExchangeUri
文字列
リッチ クライアント アプリケーションからの認証に使用されるメタデータ交換エンドポイントの URI。 samlOrWsFedProvider から継承されます。
passiveSignInUri
文字列
Azure AD サービスにサインインするときに Web ベースのクライアントが送信する URI。 samlOrWsFedProvider から継承されます。
preferredAuthenticationProtocol
String
優先認証プロトコル。 サポートされている値には、次のものが含まれますsaml。.wsfed samlOrWsFedProvider から継承されます。
signingCertificate
String
Microsoft ID プラットフォームに渡されたトークンに署名するために使用される現在の証明書。 証明書は、フェデレーション IdP のトークン署名証明書のパブリック部分の Base64 でエンコードされた文字列として書式設定され、X509Certificate2 クラスと互換性がある必要があります。 このプロパティは、次のシナリオで使用されます。 自動ロールオーバー更新の外部でロールオーバーが必要な場合 新しいフェデレーション サービスが設定されている フェデレーション サービス証明書が更新された後、新しいトークン署名証明書がフェデレーション プロパティに存在しない場合。 Azure AD は、現在の証明書の有効期限の 30 日前にフェデレーション サービス メタデータから新しい証明書を取得しようとする自動登録プロセスを使用して証明書を更新します。 新しい証明書を使用できない場合、Azure AD はメタデータを毎日監視し、新しい証明書が使用可能になるとドメインのフェデレーション設定を更新します。
応答
成功した場合、このメソッドは応答コードと samlOrWsFedExternalDomainFederation オブジェクトを応答本文に返201 Createdします。
例
要求
POST https://graph.microsoft.com/beta/directory/federationConfigurations/microsoft.graph.samlOrWsFedExternalDomainFederation
Content-Type: application/json
{
"@odata.type": "microsoft.graph.samlOrWsFedExternalDomainFederation",
"issuerUri": "https://contoso.com/issuerUri",
"displayName": "contoso display name",
"metadataExchangeUri": "https://contoso.com/metadataExchangeUri",
"passiveSignInUri": "https://contoso.com/signin",
"preferredAuthenticationProtocol": "wsFed",
"domains": [
{
"@odata.type": "microsoft.graph.externalDomainName",
"id": "contoso.com"
}
],
"signingCertificate": "MIIDADCCAeigAwIBAgIQEX41y8r6"
}
const options = {
authProvider,
};
const client = Client.init(options);
const identityProviderBase = {
'@odata.type': 'microsoft.graph.samlOrWsFedExternalDomainFederation',
issuerUri: 'https://contoso.com/issuerUri',
displayName: 'contoso display name',
metadataExchangeUri: 'https://contoso.com/metadataExchangeUri',
passiveSignInUri: 'https://contoso.com/signin',
preferredAuthenticationProtocol: 'wsFed',
domains: [
{
'@odata.type': 'microsoft.graph.externalDomainName',
id: 'contoso.com'
}
],
signingCertificate: 'MIIDADCCAeigAwIBAgIQEX41y8r6'
};
await client.api('/directory/federationConfigurations')
.version('beta')
.post(identityProviderBase);
MSHTTPClient *httpClient = [MSClientFactory createHTTPClientWithAuthenticationProvider:authenticationProvider];
NSString *MSGraphBaseURL = @"https://graph.microsoft.com/beta/";
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[MSGraphBaseURL stringByAppendingString:@"/directory/federationConfigurations"]]];
[urlRequest setHTTPMethod:@"POST"];
[urlRequest setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
MSGraphIdentityProviderBase *identityProviderBase = [[MSGraphIdentityProviderBase alloc] init];
[identityProviderBase setIssuerUri:@"https://contoso.com/issuerUri"];
[identityProviderBase setDisplayName:@"contoso display name"];
[identityProviderBase setMetadataExchangeUri:@"https://contoso.com/metadataExchangeUri"];
[identityProviderBase setPassiveSignInUri:@"https://contoso.com/signin"];
[identityProviderBase setPreferredAuthenticationProtocol: [MSGraphAuthenticationProtocol wsFed]];
NSMutableArray *domainsList = [[NSMutableArray alloc] init];
MSGraphExternalDomainName *domains = [[MSGraphExternalDomainName alloc] init];
[domains setId:@"contoso.com"];
[domainsList addObject: domains];
[identityProviderBase setDomains:domainsList];
[identityProviderBase setSigningCertificate:@"MIIDADCCAeigAwIBAgIQEX41y8r6"];
NSError *error;
NSData *identityProviderBaseData = [identityProviderBase getSerializedDataWithError:&error];
[urlRequest setHTTPBody:identityProviderBaseData];
MSURLSessionDataTask *meDataTask = [httpClient dataTaskWithRequest:urlRequest
completionHandler: ^(NSData *data, NSURLResponse *response, NSError *nserror) {
//Request Completed
}];
[meDataTask execute];
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
SamlOrWsFedExternalDomainFederation identityProviderBase = new SamlOrWsFedExternalDomainFederation();
identityProviderBase.issuerUri = "https://contoso.com/issuerUri";
identityProviderBase.displayName = "contoso display name";
identityProviderBase.metadataExchangeUri = "https://contoso.com/metadataExchangeUri";
identityProviderBase.passiveSignInUri = "https://contoso.com/signin";
identityProviderBase.preferredAuthenticationProtocol = AuthenticationProtocol.WS_FED;
LinkedList<ExternalDomainName> domainsList = new LinkedList<ExternalDomainName>();
ExternalDomainName domains = new ExternalDomainName();
domains.id = "contoso.com";
domainsList.add(domains);
ExternalDomainNameCollectionResponse externalDomainNameCollectionResponse = new ExternalDomainNameCollectionResponse();
externalDomainNameCollectionResponse.value = domainsList;
ExternalDomainNameCollectionPage externalDomainNameCollectionPage = new ExternalDomainNameCollectionPage(externalDomainNameCollectionResponse, null);
identityProviderBase.domains = externalDomainNameCollectionPage;
identityProviderBase.signingCertificate = "MIIDADCCAeigAwIBAgIQEX41y8r6";
graphClient.directory().federationConfigurations()
.buildRequest()
.post(identityProviderBase);
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
requestBody := msgraphsdk.NewIdentityProviderBase()
displayName := "contoso display name"
requestBody.SetDisplayName(&displayName)
requestBody.SetAdditionalData(map[string]interface{}{
"@odata.type": "microsoft.graph.samlOrWsFedExternalDomainFederation",
"issuerUri": "https://contoso.com/issuerUri",
"metadataExchangeUri": "https://contoso.com/metadataExchangeUri",
"passiveSignInUri": "https://contoso.com/signin",
"preferredAuthenticationProtocol": "wsFed",
"domains": []Object {
}
"signingCertificate": "MIIDADCCAeigAwIBAgIQEX41y8r6",
}
result, err := graphClient.Directory().FederationConfigurations().Post(requestBody)
Import-Module Microsoft.Graph.Identity.DirectoryManagement
$params = @{
"@odata.type" = "microsoft.graph.samlOrWsFedExternalDomainFederation"
IssuerUri = "https://contoso.com/issuerUri"
DisplayName = "contoso display name"
MetadataExchangeUri = "https://contoso.com/metadataExchangeUri"
PassiveSignInUri = "https://contoso.com/signin"
PreferredAuthenticationProtocol = "wsFed"
Domains = @(
@{
"@odata.type" = "microsoft.graph.externalDomainName"
Id = "contoso.com"
}
)
SigningCertificate = "MIIDADCCAeigAwIBAgIQEX41y8r6"
}
New-MgDirectoryFederationConfiguration -BodyParameter $params
応答
応答の例を次に示します。
注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。
HTTP/1.1 201 Created
Content-Type: application/json
{
"id": "3c41f317-9af3-4266-8ccf-26283ceec888",
"displayName": "contoso display name"
}