| title | Update customClaimsPolicy |
|---|---|
| description | Update a custom claims policy object. |
| author | rahul-nagraj |
| ms.localizationpriority | medium |
| ms.subservice | entra-id |
| doc_type | apiPageType |
| ms.date | 07/11/2024 |
Namespace: microsoft.graph
[!INCLUDE beta-disclaimer]
Update a customClaimsPolicy object.
[!INCLUDE national-cloud-support]
Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.
[!INCLUDE permissions-table]
[!INCLUDE rbac-customclaimspolicy-apis-write]
PATCH /servicePrincipals/{servicePrincipalsId}/claimsPolicy| Name | Description |
|---|---|
| Authorization | Bearer {token}. Required. Learn more about authentication and authorization. |
| Content-Type | application/json. Required. |
In the request body, supply a JSON representation of the customClaimsPolicy object.
You can specify the following properties when creating a customClaimsPolicy.
| Property | Type | Description |
|---|---|---|
| includeBasicClaimSet | Boolean | Determines whether the basic claim set is included in tokens affected by this policy. If set to true, all claims in the basic claim set are emitted in tokens affected by the policy. By default the basic claim set isn't in the tokens, unless they're explicitly configured in this policy. Optional. |
| includeApplicationIdInIssuer | Boolean | Indicates whether the application ID is added to the claim. It is relevant only for SAML2.0 and if a custom signing key is used. the default value is true. Optional. |
| audienceOverride | String | If specified, it overrides the content of the audience claim for WS-Federation and SAML2 protocols. A custom signing key must be used for audienceOverride to be applied, otherwise audienceOverride value is ignored. The value provided must be in the format of an absolute URI. Optional. |
| claims | customClaimBase collection | Defines which claims are present in the tokens affected by the policy, in addition to the basic claim and the core claim set. Optional. |
If successful, this method returns a 201 Created response code and a customClaimsPolicy object in the response body.
The following example shows a request.
PATCH https://graph.microsoft.com/beta/servicePrincipals/{servicePrincipalsId}/claimsPolicy
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.customClaimsPolicy",
"includeBasicClaimSet": "Boolean",
"includeApplicationIdInIssuer": "Boolean",
"audienceOverride": "String",
"claims": [
{
"@odata.type": "microsoft.graph.customClaim"
}
]
}[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
The following example shows the response.
Note: The response object shown here might be shortened for readability.
HTTP/1.1 201 Created
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.customClaimsPolicy",
"id": "f914f36d-167e-3fa7-cfa2-355cc5a36689",
"includeBasicClaimSet": "Boolean",
"includeApplicationIdInIssuer": "Boolean",
"audienceOverride": "String",
"claims": [
{
"@odata.type": "microsoft.graph.customClaim"
}
]
}