-
Notifications
You must be signed in to change notification settings - Fork 698
Closed
Labels
more-info-neededPlease provide a minimal example (e.g. at stackblitz.com) which demonstrates the issuePlease provide a minimal example (e.g. at stackblitz.com) which demonstrates the issuequestionFor tagging support requests and general questions.For tagging support requests and general questions.
Description
I've integrated OAuth Implicit flow in Angular 8 App, I've been getting below issue initial time especially in Firefox (incognito).
Validating access_token failed, wrong state/nonce
Initial time, there is no nonce in the local storage, how can it validateNonce (angular-oauth2-oidc.js - 2358 line) execute? This method is being thrown an exception initial time.
if (this.configService.auth) {
console.log(this.configService.auth.authRedirectUri + "*&&&&&&&&&&&&&&&&&&dd");
this.authConfig = {
issuer: 'https://login.microsoftonline.com/XXXXXX/v2.0',
redirectUri: this.configService.auth.authRedirectUri,
clientId: this.configService.auth.clientId,
scope: 'openid profile email',
strictDiscoveryDocumentValidation: false,
oidc: true,
showDebugInformation: true,
// URL of the SPA to redirect the user after silent refresh
// silentRefreshRedirectUri: window.location.origin + '/login.html',
};
this.oauthService.configure(this.authConfig);
this.oauthService.setStorage(localStorage);
this.oauthService.tokenValidationHandler = new JwksValidationHandler();
this.oauthService.setupAutomaticSilentRefresh();
// this.oauthService.silentRefreshRedirectUri = window.location.origin + '/login.html';
}
// trylogin funtion
tryLogin(state?: any): Observable<boolean | any> {
console.log("***********Try Login", state);
return Observable.create(observer => {
return this.oauthService.loadDiscoveryDocument(this.configService.auth.openIdDocument).then(() => {
console.log("***********Try Login", state);
return this.oauthService.tryLogin({}).then(() => {
observer.next(state ? state : this.isLoggedIn);
observer.complete();
}).catch(err => {
observer.error(err);
observer.complete();
});
});
});
}
Desktop (please complete the following information):
- OS: Mac, Windows
- Browser Firefox
- Version Latest
synth3, JohZed, manandkumaar, KristianI and K-Re-Zi
Metadata
Metadata
Assignees
Labels
more-info-neededPlease provide a minimal example (e.g. at stackblitz.com) which demonstrates the issuePlease provide a minimal example (e.g. at stackblitz.com) which demonstrates the issuequestionFor tagging support requests and general questions.For tagging support requests and general questions.