Skip to content
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

[Question]: Authorize - not getting called second time - multiple config #1909

Open
IC014065 opened this issue Mar 5, 2024 · 0 comments
Open
Labels

Comments

@IC014065
Copy link

IC014065 commented Mar 5, 2024

What Version of the library are you using?
... angular 15 , angular-auth-oidc-client - "version": "15.0.2"

Question
We have two configs with different scopes. One for AuthN and another for AuthZ. First time whene we call the below code it works for the first time. We call getAccessToken with configId and it calls authorize endpoint and then token and returns the token.

constructor(
private oidcSecurityService: OidcSecurityService,
@Inject(windowToken) private window: Window
) {
this.isAuthenticated$.subscribe(() => {
oidcSecurityService
.getAccessToken('Authentication')
.pipe(take(1))
.subscribe((accessToken) => {
this.accessToken = accessToken;
});
});

But when we call getAccessToken for the second time, it neither calls authorize or nor token endpoint.

getUserAuthorizationAccessToken(): void {
this.isAuthenticated$.subscribe(() => {
this.oidcSecurityService
.getAccessToken('userAuthorization')
.pipe(take(1))
.subscribe((userAuthorizationToken) => {
console.log('userAuthorizationToken', userAuthorizationToken);
this.userAuthorizationToken = userAuthorizationToken;
});
});
}

We even tried the checkAuthMultiple() to explicitly authorize and also this.oidcSecurityService.authorize('userAuthorization');.
But its not calling authorize endpoint or token and hence no token received second time.

Any help would be much appreciated..!

Thanks,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant