简体   繁体   中英

Azure Ad B2C: How to use use msal-angular to pass parameter which still available in redirect url

I'm using @azure/msal-angular to login with Azure AD B2C account. I'd like to pass some customized parameters which will be still available when it redirect back.

I read some documents here which said we can use "state" to bring some parameters, but I can't find any sample how to define customized parameters in state and how to get it when redirect back.

Any help would be greatly appreciate!

Would it be possible for you to share the code (just relevant fragments) that you are working with? The doc you link clearly shows how to use the state parameters.

If you look at the sample code (link in the document, but here it is) you can add the state parameter to the login request.

authConfig.js

// Add here scopes for id token to be used at MS Identity Platform endpoints.
const loginRequest = {
  scopes: ["openid", "profile", "User.Read"],
  state: "YOUR_STATE" // <-- Set your state parameter.
};

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