I'm using angular-oauth2-oidc
's Code Flow in an Angular application. It's working all good, however I cannot read the user claims.
I tried using this.oAuthService.getIdToken()
, this.oAuthService.getAccessToken()
, this.oauthService.getUserInfo()
but I don't seem to get any valid JWT that can be decoded using regular methods.
In my backend API (.NET Core) I use the access_token
to query the TokenIntrospection endpoint and I can see all the claims properly.
Relevant info:
export const oAuthConfig: AuthConfig = {
issuer: environment.oauth.issuer,
// URL of the SPA to be redirected to after login
redirectUri: environment.oauth.redirectUri,
clientId: environment.oauth.clientId,
dummyClientSecret: environment.oauth.clientSecret,
responseType: 'code',
scope: 'openid profile email',
showDebugInformation: true,
oidc: true,
requireHttps: false,
};
async login() {
await this.oAuthService.loadDiscoveryDocumentAndTryLogin();
await this.oAuthService.initCodeFlow();
this.router.navigate(['/']);
}
Any suggestions? Thanks for the help.