Does Azure B2C provide REST API for login?

Viewed 3511

I have one application integrated with Azure B2C directory. Our problem is, login page is redirecting to Azure B2C portal (Own custom page) for authenticate or Authorize users and then revert back to the original website.

I need to open popup with my own website login design and at the backend, I am able to call Azure B2C REST api to validate users.

How I can create REST API for Login in Azure B2C portal?

Let me know if you have any information about the same.

1 Answers

As juunas said in the comment, you could use resource owner password credentials(ROPC) flow to validate users at the backend. You could call the API with the POST request at the end. Note: ROPC supports local accounts only.

Try to create resource owner user flow first.

enter image description here

You need to replace the username and password with the user's to be verified.

POST https://<tenant-name>.b2clogin.com/<tenant-name>.onmicrosoft.com/B2C_1A_<ROPC_Auth name of the flow>/oauth2/v2.0/token

username=<username>
&password=<password>
&grant_type=password
&scope=openid <application-id> offline_access
&client_id=<application-id>
&response_type=token+id_token
Related