简体   繁体   中英

.Net Core 3.1 - how to generate Sign Up link for Azure AD B2C?

I use Azure AD B2C for my ASP.NET Core 3.1 web app. Currently, there's built-in UI for users to log in - basically, let's pretend it's just a scaffolded new app in VS2019 with Azure B2C authentication.

But I need to customize this UI and to generate "Sign Up" link in particular. How to do this?

As you would do for any policy or user flow :

https://{tenant}.b2clogin.com/{tenant}.onmicrosoft.com/{policy}/oauth2/v2.0/authorize?client_id={b2c app id}&response_type=code&redirect_uri={b2c app redirect uri, depending on the sdk used this may be a specific}&response_mode=query&scope={b2c app scope}&state={custom data}

Eg:

https://contoso.b2clogin.com/contoso.onmicrosoft.com/b2c_1_sign_up/oauth2/v2.0/authorize?client_id=90c0fe63-bcf2-44d5-8fb7-b8bbc0b29dc6&response_type=code&redirect_uri=https://myapp.azurewebsites.com/&response_mode=query&scope=90c0fe63-bcf2-44d5-8fb7-b8bbc0b29dc6%20offline_access&state=arbitrary_data_you_can_receive_in_the_response

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM