Azure B2C How to assign b2c login user flow to www.example.com url

Mohamed Umair Mohamed Anhar 41 Reputation points
2020-08-18T09:52:05.08+00:00

If i use localhost:4200 url for the 4200 url the login user flow should come
but it redirect to userflow url like https://test.b2clogin.com/test.onmicrosoft.com/oauth2/v2.0/authorize?

how can i change to http://localhost:4200 or www.example.com

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,666 questions
0 comments No comments
{count} votes

Accepted answer
  1. AmanpreetSingh-MSFT 56,311 Reputation points
    2020-08-18T10:23:52.693+00:00

    Hello @Mohamed Umair Mohamed Anhar

    Based on your application configuration, you should get redirected to https://test.b2clogin.com/test.onmicrosoft.com/oauth2/v2.0/authorize? endpoint for authentication along with few extra parameters, such as:

    • client_id
    • nonce
    • redirect_uri
    • scope
    • response_type

    And the complete redirect URL should look like this:
    https://test.b2clogin.com/test.onmicrosoft.com/oauth2/v2.0/authorize?p=B2C_1A_signup_signin&client_id=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx&nonce=defaultNonce&redirect_uri=http://localhost:4200&scope=openid&response_type=id_token&prompt=login

    Once B2C completes the authentication process, it posts the reponse based on response_type parameter which can be code, id_token or token to the redirect_uri, which is localhost:4200 in your case. When the response is posted by B2C, you should automatically get redirected to localhost:4200. For www.example.com, the redirect_uri must be set to www.example.com.

    Here is a sample for Single page apps. If you have Mobile and desktop app or Web app and API, you can refer to the samples here: https://learn.microsoft.com/en-us/azure/active-directory-b2c/code-samples

    -----------------------------------------------------------------------------------------------------------

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

    2 people found this answer helpful.

0 additional answers

Sort by: Most helpful