Generate Bearer token in postman using user managed identity without using any secrete

DhatyaSri-3920 0 Reputation points
2023-11-11T18:00:08.94+00:00

I wanted to know that is there any possibility to generate bearer token using user managed identity.

I am able to generate using VM & AZ CLI but i am unable to generate using postman.

Microsoft Security | Microsoft Entra | Microsoft Entra ID
{count} votes

1 answer

Sort by: Most helpful
  1. Navya 19,795 Reputation points Microsoft External Staff Moderator
    2023-11-14T10:22:10.2466667+00:00

    Hi @DhatyaSri-3920

    Thank you for posting this in Microsoft Q&A.

    I understand you want to generate Bearer token in postman using user managed identity without using any secrete.

    Yes, it is possible to generate a bearer token using user managed identity in Postman with OAuth ROPC flow when using public applications. For confidential applications we must need client_secret

    If your application is public app follow the below steps.

    Create App service and then add User Assigned managed identity.
    User's image

    To get access token using User assigned Managed Identity, you need to include one of the optional parameters like client_id .

    You can find values of these parameters from your managed identity:

    Go to Managed Identities -> select your Managed Identity

    User's image

    The Postman request will be containing below parameters.

    URL: https://login.microsoftonline.com/{tenantid}/oauth2/token

    Method: POST

    Header: Content-Type: application/x-www-form-urlencoded

    Under Body use below variables

    Client_id : Replace your managed identity client_id

    resource: https://graph.microsoft.com

    subscription id: your application subscription id

    grant_type: password

    username and Password: Replace your username and password.

    User's image

    you will get bearer token as below.
    User's image

    For more information regarding OAuth ROPC flow

    Hope this helps. Do let us know if you any further queries.

    Thanks,

    Navya.

    1 person found this answer helpful.

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.