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.
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
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.
you will get bearer token as below.
For more information regarding OAuth ROPC flow
Hope this helps. Do let us know if you any further queries.
Thanks,
Navya.