-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missed state when create a new UserAgentApplication #778
Comments
Hi @dluque92, we allow the user to pass a state in the AuthenticationParameters object, which is the object sent in the login and acquireToken requests. /**
* @link AuthenticationParameters}AuthenticationParameters
*/
export type AuthenticationParameters = {
scopes?: Array<string>;
extraScopesToConsent?: Array<string>;
prompt?: string;
extraQueryParameters?: QPDict;
claimsRequest?: string;
authority?: string;
state?: string;
correlationId?: string;
account?: Account;
sid?: string;
loginHint?: string;
}; Example: let loginRequest = {
state = "1234"
};
loginPopup(loginRequest).then(loginResponse => {
let responseState = loginResponse.accountState;
}).catch(error => {
console.log(error);
}); This pattern should be the same for all of the login and acquiretoken APIs. Please let me know if you are still having issues. |
@pkanher617 I got tslint error when try to pass state property, because its not defined in type |
Hm I haven't received this error before. Could you post a code snippet of your acquireToken or login call and the request object you are constructing? |
Hi @pkanher617 the new UserAgentApplication expects config with this format:
|
@dluque92 As of MSAL.js v1.0.0, we no longer accept state as a configuration parameter. This is because the state needs to be set per request, not per instance of MSAL. The new configuration objects and parameters can be found here. We have also changed how the requests for login and acquireToken are made. A new object called AuthenticationParameters is now used to pass state. |
@dluque92 To expand specifically how a request looks: export type AuthenticationParameters = { We will be sticking to this more or less(except may be adding some more params if there is a user need). Please check the 1.0.0 announcement for more details. |
@sameerag Then this file is wrong:
|
@dluque92 Thanks for pointing that out. I will fix the comments right now. |
@pkanher617 But also, the AuthenticationParameters has been changed, As you said here How can we pass state in this case?
|
@dluque92 This is still the configuration object. Please see my above comment and the AuthenticationParameters.ts class. |
@dluque92 as @pkanher617 mentioned above, AuthenticationParameters.ts class has the detail on how to send the 'state' per request. Closing this issue as #780 is in dev. |
I'm submitting a...
Browser:
Library version
If is not included since new versions, how can I manage it, and pass state? I need it to control state after callback in SignIn or EditProfile policies
The text was updated successfully, but these errors were encountered: