I am trying to sign in to azure / get a token for with policy id by postman

Andrew Shlykov 0 Reputation points
2024-09-10T19:53:34.44+00:00

I am trying to sign in to azure with custom policy / policy work fine when fo the application but does not work for postman

enter image description here It logins fine when I am using the client endpoint

https://login.microsoftonline.com/XXXXXXXXXXXXXX/oauth2/v2.0/token but fails for

https://XXXXXXXXXX.b2clogin.com/XXXXXXXXXX.onmicrosoft.com/<policy-name>/oauth2/v2.0/token

importunely the policy defines all the needed claims

policy is taken form custom policy xml PolicyId="XXXXXXXXX"

enter image description here

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
21,469 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Raja Pothuraju 5,580 Reputation points Microsoft Vendor
    2024-09-20T16:08:05.7333333+00:00

    Hello @Andrew Shlykov,

    Thank you for posting your query on Microsoft Q&A.

    Based on your description, I see that you are able to generate a token using the Entra ID token endpoint: https://login.microsoftonline.com/XXXXXXXXXXXXXX/oauth2/v2.0/token. However, when using the B2C token endpoint: https://<tenant-name>.b2clogin.com/<tenant-name>.onmicrosoft.com/B2C_1A_ROPC_Auth/oauth2/v2.0/token, you're encountering an error.

    To help validate the issue, I recommend trying the following URL format:

    https://<tenant-name>.b2clogin.com/<tenant-name>.onmicrosoft.com/oauth2/v2.0/token?p=B2C_1A_ROPC_Auth

    If this URL results in the same error, please try changing the scope in your request to "openid application-id offline_access." By doing this, we can verify if the issue is related to the scope.

    For reference, you can check the documentation here: Azure Active Directory B2C - Add ROPC Policy.

    If you encounter any AADSTS errors, please share them with us in the comments section, and if the issue persists, we can take this offline for further testing.

    I hope this information is helpful. Please feel free to reach out if you have any further questions.

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Thanks,
    Raja Pothuraju.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.