angular-auth-oidc-client
angular-auth-oidc-client copied to clipboard
[Question]: Why does my application always redirects to OIDC server after page refresh instead of use local session data
What Version of the library are you using? ^14.1.4
Question When refreshing the angular application page in a webbrowser after logging in, the user is always redirected to the authentication page first. As a session still exists, the user is redirected back directly, but it feels somehow as too much redirects as all information is already available in session storage from the first view and the access token is still valid.
my first lines in app.component are
this.oidcSecurityService.getConfiguration().subscribe((result) => this.oidcAuthority = result.authority);
this.oidcSecurityService.checkAuth().subscribe(response => {console.log(response)});
but the console logs that isAuthenticated=false.
in our guards we also use this.oidcSecurityService.isAuthenticated$, but also there isAuthenticated is false.
after being redirected to the login provider and back, everything works as planned.
I presume I am missing something, but what should that be?
Thanks in advance!
Hello wzoet i had also same issue i fixed this issue by adding the below code
step:1 Create the Localstorage class
step2 : add that class in the configuration under storage section
step3:add the provide in appmodule.ts
import { AbstractSecurityStorage } from 'angular-auth-oidc-client'