release version 8.0.4 tryLogin() does not work
See original GitHub issueI’m using release version of 8.0.4 in my angular 8 project with authorization code flow:
here is the code I have
this.oauthService.configure(authConfig);
this.oauthService.tokenValidationHandler = new JwksValidationHandler();
this.oauthService
.loadDiscoveryDocument()
.then(() => this.oauthService.tryLogin()) ---> [1]
.then(() => {
if (this.oauthService.hasValidAccessToken()) {
return Promise.resolve();
}else{
this.oauthService.initCodeFlow() ---> [2]
}
});
}
Initially when user is not logged in the code at [2] redirects user to login page. Once user provides username/password and click login, the identity provider redirects back to app with “code” in querystring, that is when I’m expecting code at [1] to login the user with code (by redeeming it for tokens).
Instead the tryLogin() method doesn’t work and the user is again redirected to authorzation endpoint in endless loop.
Please help me understand, what is going wrong here.
also, does this example : https://github.com/jeroenheijmans/sample-angular-oauth2-oidc-with-auth-guards/ apply for version 8 ?
Issue Analytics
- State:
- Created 3 years ago
- Comments:6
Top Results From Across the Web
angular-oauth2-oidc tryLogin() not working as expected
This function could be used to figure out whether you are already logged-in or not: public isLoggedIn(): Promise<boolean> { return this.
Read more >angular-oauth2-oidc - Bountysource
Method loadDiscoveryDocumentAndTryLogin() always resolves to true for code flow, which is unexpected, Even the documentation at https://manfredsteyer.github.io/ ...
Read more >OAuthService - angular-oauth2-oidc
Convenience method that first calls loadDiscoveryDocumentAndTryLogin(...) and if then chains to initLoginFlow() , but only if there is no valid IdToken or no ......
Read more >Changelog - Nextcloud
We recommend you follow our Release Channels to always have the latest and most secure ... Update timely and don't run unmaintained Nextcloud...
Read more >Common Problems in Extension Mobility - Cisco Community
Try login to EM. Error:- Login is unavailable(213). Resolution:- This error comes when the device or phone load does not support ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Cool, thx for sharing @jodotlearn! Had not realized that might be affecting things.
I presume we can close the issue then? Let us know if there’s still a problem and we could consider reopening.
Thank you @jeroenheijmans
I found my project enabled HashStrategy. Now I disable initial navigation following the Routing with the HashStrategy, and work fine.