I have two applications registered in AD tenant(lets say App A and App B).
App A has API access to App B and it uses client credential flow to acquire access token.
Access token expire time is 60mins default and Requirement is to set 10mins.
I have followed instructions available on these links,
configurable-token-lifetimes and StackoverflowQuestion.
But it is not working. When i try to get access token using postman client credential flow, still i am getting 60mins only.
I have applied the AD policy to Both application and service principal of App A.
> New-AzureADPolicy -Definition-Definition
> @('{"TokenLifetimePolicy":{"Version":1,"AccessTokenLifetime":"00:10:00","MaxAgeSessionSingleFactor":"00:10:00",
> "MaxInactiveTime":"00:10:00","MaxAgeMultiFactor":"until-revoked","MaxAgeSingleFactor":"00:10:00"}}')
> -DisplayName "Acesstokenlifetimeforchilemail" -IsOrganizationDefault $false -Type "TokenLifetimePolicy"
> Add-AzureADApplicationPolicy -Id de1cc996-3ce6-4902-8a94-da9858b955cb -RefObjectId
> 10107ca9-bd7a-4c38-beb5-20d84a3a0806
> Add-AzureADServicePrincipalPolicy -Id f6340519-e9e4-46d4-8d5d-7d93e0936c1e -RefObjectId
> 10107ca9-bd7a-4c38-beb5-20d84a3a0806
I verified whether policy is applied to app and service principal.
> PS C:\WINDOWS\system32> Get-AzureADPolicyAppliedObject -Id
> 10107ca9-bd7a-4c38-beb5-20d84a3a0806
> de1cc996-3ce6-4902-8a94-da9858b955cb #microsoft.graph.application
> f6340519-e9e4-46d4-8d5d-7d93e0936c1e #microsoft.graph.servicePrincipal
I have checked the postman script also. I am using same tenant and token point.
Please help me to fix the issue.