Iam following this link https://docs.microsoft.com/en-us/azure/active-directory-b2c/access-tokens. But how we get access token through an api using username and password for Local Accounts and by only username for google accounts.
Iam following this link https://docs.microsoft.com/en-us/azure/active-directory-b2c/access-tokens. But how we get access token through an api using username and password for Local Accounts and by only username for google accounts.
Hi @SRI-5106 · Thanks for reaching out.
The username/password (ROPC flow) can only be used for local accounts, where both username and password is stored in the directory whose token endpoint you are making a call to. That is why username/password (ROPC flow) works only for Local Accounts.
If you want to acquire a token using Social Account created via Google IDP via API, you need to use Authorization_Code grant flow. This requires manual/user interaction as the redirection needs to be done to Google IDP. For this purpose, please refer to below steps from the document you are referring to:

Please "Accept the answer" if the information helped you. This will help us and others in the community as well.
Hi @amanpreetsingh-msft ,
Thank you for your response.
i want to get token for particular user through api. That user is created by google identity provider.
if ROPC user flow is not supporting ,than how can i get token by an api of particular user who is registered by google identity provider to protect my backend apis?
Hi @SRI-5106 · You need to use Authorization_Code grant flow. I have already provided details about it in my answer above.
Please "Accept the answer" if the information helped you. This will help us and others in the community as well.
7 people are following this question.