hello.js icon indicating copy to clipboard operation
hello.js copied to clipboard

Azure B2C Passing ui_locales query param

Open bolicd opened this issue 7 years ago • 1 comments

For localization Azure B2C requires query param called: ui_locales=en to be passed.

Currently im passing it by concatenating string in hello.js init configuration for auth and grant endpoints location like so:

oauth: { version: 2, auth: "https://login.microsoftonline.com/tfp/" + tenantName + "/" + signInSignUpPolicyName + "/oauth2/v2.0/authorize?ui_locales=sv", grant: "https://login.microsoftonline.com/tfp/" + tenantName + "/" + signInSignUpPolicyName + "/oauth2/v2.0/token?ui_locales=sv" },

Is there a better way to pass ui_locales query param using hello.js ? (didnt find anything in api documentation)?

Thanks

bolicd avatar Jul 18 '17 13:07 bolicd

Any parameters which are unrecognized when calling hello.login are appended to the initial request.

hello(network).login({ui_locales:'en'});`

You might prefer to hard bake it like you have, by alternatively assigning a login function, e.g.

...

login(req) {
    // add an additional parameter to the login function
    req.qs.ui_locales = 'en';

   // you might consider updating the grant path on the fly too
   /// this.oauth.grant += 'ui_locales=en';
}
...

Here you might like to play around with manipulating the oauth.grant to include the ui_locales if that's what you need to do.

MrSwitch avatar Jul 18 '17 14:07 MrSwitch