Reputation: 490
It is possible to pass extra query parameters from the web application that calls the B2C policy.
With MSAL: AuthenticationParameters.extraQueryParameters
{
extraQueryParameters: { ['utm_source']: window.location.origin },
}
This will add "&utm_source=something.com" in the URL
mytenant.b2clogin.com/mytenant.onmicrosoft.com/oauth2/v2.0/authorize?p=B2C_1A_signup_signin&utm_source=something.com&.....
My problem is that as soon as I jump to a second page, or click on the Sign Up link, you completely loose all of these extra query parameters.
i.e You click on SignUp, the url is now
mytenant.b2clogin.com/mytenant.onmicrosoft.com/B2C_1A_signup_signin/api/CombinedSigninAndSignup/unified?local=signup&csrf_token=123456&tx=StateProperties=123456&p=B2C_1A_signup_signin
How can I keep these extra query params?
How can I also keep these params when you go to a Social IDP then back on the social confirmation page?
Upvotes: 0
Views: 1441
Reputation: 11315
Resolve the query parameters in the initial page. Then it doesn’t matter what the user does next.
Upvotes: 1