更新 samlOrWsFedExternalDomainFederation
命名空间:microsoft.graph
重要
Microsoft Graph版本下的 /beta API 可能会发生更改。 不支持在生产应用程序中使用这些 API。 若要确定 API 是否在 v1.0 中可用,请使用 版本 选择器。
更新 samlOrWsFedExternalDomainFederation 对象的 属性。
权限
要调用此 API,需要以下权限之一。要了解详细信息,包括如何选择权限的信息,请参阅权限。
| 权限类型 |
权限(从最低特权到最高特权) |
| 委派(工作或学校帐户) |
IdentityProvider.ReadWrite.All |
| 委派(Microsoft 个人帐户) |
不支持。 |
| 应用程序 |
IdentityProvider.ReadWrite.All |
工作或学校帐户需要属于以下 Azure Active Directory (Azure AD) 角色之一:
HTTP 请求
PATCH directory/federationConfigurations/graph.samlOrWsFedExternalDomainFederation/{samlOrWsFedExternalDomainFederation ID}
| 名称 |
说明 |
| Authorization |
Bearer {token}。必需。 |
| Content-Type |
application/json. Required. |
请求正文
在请求正文中,为 JSON 对象提供一个或多个属性,这些属性需要针对 Azure AD 租户中的 samlOrWsFedExternalDomainFederation 对象进行更新。
下表显示了可以针对 samlOrWsFedExternalDomainFederation 对象更新的属性。
| 属性 |
类型 |
说明 |
| displayName |
String |
基于 SAML/WS-Fed 的标识提供者的显示名称。 继承自 identityProviderBase。 |
| issuerUri |
String |
联合服务器的颁发者 URI。 继承自 samlOrWsFedProvider。 |
| metadataExchangeUri |
String |
用于从丰富的客户端应用程序进行身份验证的元数据交换终结点的 URI。 继承自 samlOrWsFedProvider。 |
| passiveSignInUri |
字符串 |
登录到 Azure AD 服务时基于 Web 的客户端定向到的 URI。 继承自 samlOrWsFedProvider。 |
| preferredAuthenticationProtocol |
字符串 |
首选身份验证协议。 支持的值包括 saml 或 wsfed. 继承自 samlOrWsFedProvider。 |
| signingCertificate |
String |
用于对传递给Microsoft 标识平台的令牌进行签名的当前证书。 该证书的格式设置为联合 IdP 令牌签名证书公共部分的 Base64 编码字符串,并且必须与 X509Certificate2 类兼容。
此属性在以下方案中使用: - 如果自动滚动更新外部需要滚动更新
- 正在设置新的联合身份验证服务
- 如果更新联合身份验证服务证书后,联合身份验证属性中不存在新的令牌签名证书。
Azure AD 通过自动滚动更新过程更新证书,在此过程中,Azure AD 会尝试在当前证书过期前 30 天从联合身份验证服务元数据中检索新证书。 如果新证书不可用,Azure AD 将每天监视元数据,并在有新证书可用时更新域的联合身份验证设置。 |
响应
如果成功,此方法在响应正文中返回 200 OK 响应代码和更新 的 samlOrWsFedExternalDomainFederation 对象。
示例
请求
PATCH https://graph.microsoft.com/beta/directory/federationConfigurations/graph.samlOrWsFedExternalDomainFederation/d5a56845-6845-d5a5-4568-a5d54568a5d5
Content-Type: application/json
{
"displayName": "Contoso name change",
"issuerUri": "http://contoso-test.com/adfs/services/trust",
"metadataExchangeUri": null,
"signingCertificate": "M66C6DCCAdCgAwIBAgIQQ6vYJIVKQ",
"passiveSignInUri": "https://contoso-test.com/adfs/ls/",
"preferredAuthenticationProtocol": "wsFed"
}
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var samlOrWsFedExternalDomainFederation = new SamlOrWsFedExternalDomainFederation
{
DisplayName = "Contoso name change",
IssuerUri = "http://contoso-test.com/adfs/services/trust",
MetadataExchangeUri = null,
SigningCertificate = "M66C6DCCAdCgAwIBAgIQQ6vYJIVKQ",
PassiveSignInUri = "https://contoso-test.com/adfs/ls/",
PreferredAuthenticationProtocol = AuthenticationProtocol.WsFed
};
await graphClient.Directory.FederationConfigurations["{samlOrWsFedExternalDomainFederation-id}"]
.Request()
.UpdateAsync(samlOrWsFedExternalDomainFederation);
const options = {
authProvider,
};
const client = Client.init(options);
const samlOrWsFedExternalDomainFederation = {
displayName: 'Contoso name change',
issuerUri: 'http://contoso-test.com/adfs/services/trust',
metadataExchangeUri: null,
signingCertificate: 'M66C6DCCAdCgAwIBAgIQQ6vYJIVKQ',
passiveSignInUri: 'https://contoso-test.com/adfs/ls/',
preferredAuthenticationProtocol: 'wsFed'
};
await client.api('/directory/federationConfigurations/graph.samlOrWsFedExternalDomainFederation/d5a56845-6845-d5a5-4568-a5d54568a5d5')
.version('beta')
.update(samlOrWsFedExternalDomainFederation);
MSHTTPClient *httpClient = [MSClientFactory createHTTPClientWithAuthenticationProvider:authenticationProvider];
NSString *MSGraphBaseURL = @"https://graph.microsoft.com/beta/";
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[MSGraphBaseURL stringByAppendingString:@"/directory/federationConfigurations/graph.samlOrWsFedExternalDomainFederation/d5a56845-6845-d5a5-4568-a5d54568a5d5"]]];
[urlRequest setHTTPMethod:@"PATCH"];
[urlRequest setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
MSGraphSamlOrWsFedExternalDomainFederation *samlOrWsFedExternalDomainFederation = [[MSGraphSamlOrWsFedExternalDomainFederation alloc] init];
[samlOrWsFedExternalDomainFederation setDisplayName:@"Contoso name change"];
[samlOrWsFedExternalDomainFederation setIssuerUri:@"http://contoso-test.com/adfs/services/trust"];
[samlOrWsFedExternalDomainFederation setMetadataExchangeUri: null];
[samlOrWsFedExternalDomainFederation setSigningCertificate:@"M66C6DCCAdCgAwIBAgIQQ6vYJIVKQ"];
[samlOrWsFedExternalDomainFederation setPassiveSignInUri:@"https://contoso-test.com/adfs/ls/"];
[samlOrWsFedExternalDomainFederation setPreferredAuthenticationProtocol: [MSGraphAuthenticationProtocol wsFed]];
NSError *error;
NSData *samlOrWsFedExternalDomainFederationData = [samlOrWsFedExternalDomainFederation getSerializedDataWithError:&error];
[urlRequest setHTTPBody:samlOrWsFedExternalDomainFederationData];
MSURLSessionDataTask *meDataTask = [httpClient dataTaskWithRequest:urlRequest
completionHandler: ^(NSData *data, NSURLResponse *response, NSError *nserror) {
//Request Completed
}];
[meDataTask execute];
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
SamlOrWsFedExternalDomainFederation samlOrWsFedExternalDomainFederation = new SamlOrWsFedExternalDomainFederation();
samlOrWsFedExternalDomainFederation.displayName = "Contoso name change";
samlOrWsFedExternalDomainFederation.issuerUri = "http://contoso-test.com/adfs/services/trust";
samlOrWsFedExternalDomainFederation.metadataExchangeUri = null;
samlOrWsFedExternalDomainFederation.signingCertificate = "M66C6DCCAdCgAwIBAgIQQ6vYJIVKQ";
samlOrWsFedExternalDomainFederation.passiveSignInUri = "https://contoso-test.com/adfs/ls/";
samlOrWsFedExternalDomainFederation.preferredAuthenticationProtocol = AuthenticationProtocol.WS_FED;
graphClient.directory().federationConfigurations().graph.samlOrWsFedExternalDomainFederation("d5a56845-6845-d5a5-4568-a5d54568a5d5")
.buildRequest()
.patch(samlOrWsFedExternalDomainFederation);
响应
下面展示了示例响应。
注意: 为了提高可读性,可能缩短了此处显示的响应对象。
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": "d5a56845-6845-d5a5-4568-a5d54568a5d5",
"displayName": "Contoso name change",
"issuerUri": "http://contoso-test.com/adfs/services/trust",
"metadataExchangeUri": null,
"signingCertificate": "M66C6DCCAdCgAwIBAgIQQ6vYJIVKQ",
"passiveSignInUri": "https://contoso-test.com/adfs/ls/",
"preferredAuthenticationProtocol": "wsFed",
"domains": [
{
"id": "contoso.com"
}
]
}