APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.
In the request body, supply only the values for properties that should be updated. Existing properties that are not included in the request body will maintain their previous values or be recalculated based on changes to other property values.
The following table specifies the properties that can be updated.
You must specify the @odata.type property when updating a customAuthenticationExtension object. For example, to update an onTokenIssuanceStartCustomExtension object type, set the @odata.type property to #microsoft.graph.onTokenIssuanceStartCustomExtension.
// Code snippets are only available for the latest version. Current version is 5.x
var graphClient = new GraphServiceClient(requestAdapter);
var requestBody = new CustomAuthenticationExtension
{
OdataType = "#microsoft.graph.onTokenIssuanceStartCustomExtension",
DisplayName = "onTokenIssuanceStartCustomExtension",
Description = "Fetch additional claims from custom user store",
EndpointConfiguration = new CustomExtensionEndpointConfiguration
{
OdataType = "#microsoft.graph.httpRequestEndpoint",
AdditionalData = new Dictionary<string, object>
{
{
"targetUrl" , "https://authenticationeventsAPI.contoso.com"
},
},
},
AuthenticationConfiguration = new CustomExtensionAuthenticationConfiguration
{
OdataType = "#microsoft.graph.azureAdTokenAuthentication",
AdditionalData = new Dictionary<string, object>
{
{
"resourceId" , "api://authenticationeventsAPI.contoso.com/a13d0fc1-04ab-4ede-b215-63de0174cbb4"
},
},
},
AdditionalData = new Dictionary<string, object>
{
{
"claimsForTokenConfiguration" , new List<>
{
new
{
ClaimIdInApiResponse = "DateOfBirth",
},
new
{
ClaimIdInApiResponse = "CustomRoles",
},
}
},
},
};
var result = await graphClient.Identity.CustomAuthenticationExtensions["{customAuthenticationExtension-id}"].PatchAsync(requestBody);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
OnTokenIssuanceStartCustomExtension customAuthenticationExtension = new OnTokenIssuanceStartCustomExtension();
customAuthenticationExtension.displayName = "onTokenIssuanceStartCustomExtension";
customAuthenticationExtension.description = "Fetch additional claims from custom user store";
HttpRequestEndpoint endpointConfiguration = new HttpRequestEndpoint();
endpointConfiguration.targetUrl = "https://authenticationeventsAPI.contoso.com";
customAuthenticationExtension.endpointConfiguration = endpointConfiguration;
AzureAdTokenAuthentication authenticationConfiguration = new AzureAdTokenAuthentication();
authenticationConfiguration.resourceId = "api://authenticationeventsAPI.contoso.com/a13d0fc1-04ab-4ede-b215-63de0174cbb4";
customAuthenticationExtension.authenticationConfiguration = authenticationConfiguration;
LinkedList<OnTokenIssuanceStartReturnClaim> claimsForTokenConfigurationList = new LinkedList<OnTokenIssuanceStartReturnClaim>();
OnTokenIssuanceStartReturnClaim claimsForTokenConfiguration = new OnTokenIssuanceStartReturnClaim();
claimsForTokenConfiguration.claimIdInApiResponse = "DateOfBirth";
claimsForTokenConfigurationList.add(claimsForTokenConfiguration);
OnTokenIssuanceStartReturnClaim claimsForTokenConfiguration1 = new OnTokenIssuanceStartReturnClaim();
claimsForTokenConfiguration1.claimIdInApiResponse = "CustomRoles";
claimsForTokenConfigurationList.add(claimsForTokenConfiguration1);
customAuthenticationExtension.claimsForTokenConfiguration = claimsForTokenConfigurationList;
graphClient.identity().customAuthenticationExtensions("6fc5012e-7665-43d6-9708-4370863f4e6e")
.buildRequest()
.patch(customAuthenticationExtension);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
<?php
// THIS SNIPPET IS A PREVIEW FOR THE KIOTA BASED SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($requestAdapter);
$requestBody = new CustomAuthenticationExtension();
$requestBody->set@odatatype('#microsoft.graph.onTokenIssuanceStartCustomExtension');
$requestBody->setDisplayName('onTokenIssuanceStartCustomExtension');
$requestBody->setDescription('Fetch additional claims from custom user store');
$endpointConfiguration = new CustomExtensionEndpointConfiguration();
$endpointConfiguration->set@odatatype('#microsoft.graph.httpRequestEndpoint');
$additionalData = [
'targetUrl' => 'https://authenticationeventsAPI.contoso.com',
];
$endpointConfiguration->setAdditionalData($additionalData);
$requestBody->setEndpointConfiguration($endpointConfiguration);
$authenticationConfiguration = new CustomExtensionAuthenticationConfiguration();
$authenticationConfiguration->set@odatatype('#microsoft.graph.azureAdTokenAuthentication');
$additionalData = [
'resourceId' => 'api://authenticationeventsAPI.contoso.com/a13d0fc1-04ab-4ede-b215-63de0174cbb4',
];
$authenticationConfiguration->setAdditionalData($additionalData);
$requestBody->setAuthenticationConfiguration($authenticationConfiguration);
$additionalData = [
'claimsForTokenConfiguration' => $claimsForTokenConfiguration1 = new ();
$ claimsForTokenConfiguration1->setClaimIdInApiResponse('DateOfBirth');
$claimsForTokenConfigurationArray []= $claimsForTokenConfiguration1;
$claimsForTokenConfiguration2 = new ();
$ claimsForTokenConfiguration2->setClaimIdInApiResponse('CustomRoles');
$claimsForTokenConfigurationArray []= $claimsForTokenConfiguration2;
$requestBody->setClaimsForTokenConfiguration($claimsForTokenConfigurationArray);
];
$requestBody->setAdditionalData($additionalData);
$result = $graphServiceClient->identity()->customAuthenticationExtensions()->byCustomAuthenticationExtensionId('customAuthenticationExtension-id')->patch($requestBody);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.