question

SRI-5106 avatar image
0 Votes"
SRI-5106 asked amanpreetsingh-msft commented

how to get token for Google sign in and sign up identity provider in Azure AD B2C applictaion through an api. ?

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.

azure-ad-connect
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

amanpreetsingh-msft avatar image
0 Votes"
amanpreetsingh-msft answered amanpreetsingh-msft commented

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:

103002-image.png


Please "Accept the answer" if the information helped you. This will help us and others in the community as well.


image.png (55.2 KiB)
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @SRI-5106 · Just checking if you have any further question.

0 Votes 0 ·
SRI-5106 avatar image SRI-5106 amanpreetsingh-msft ·

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?
0 Votes 0 ·

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.

0 Votes 0 ·