Programming
azure-active-directory azure-ad-b2c azure-ad-graph-api
Updated Mon, 15 Aug 2022 23:49:06 GMT

Redeem refresh token in Azure AD B2C against any custom policy


I am not able to redeem new tokens(access and refresh) using refresh token received against different policy token end point.

Received refresh token A from https://tenant.b2clogin.com/tenant.onmicrosoft.com/oauth2/v2.0/token?p=b2c_1a_signup.

Redeem token A against same endpoint(policy b2c_1a_signup) is working.

But If i redeem against different policy endpoint https://tenant.b2clogin.com/tenant.onmicrosoft.com/oauth2/v2.0/token?p=b2c_1a_signin. is not working. (Policy b2c_1a_signin).

Our app is using totally 4 policies and it will get access and refresh token from all policies. It is difficult store and map the refresh token against the policy.

Please help me find a way to redeem always against one token end point irrespective of token end point used to get token initially.




Solution

It isn't allowed to exchange a refresh token, which was issued for one policy, for an access token, which is to be issued for another policy.

You will have to save the policy identifier with the refresh token so that you can exchange this refresh token with that policy identifier.







External Links

External links referenced by this document: