0

I'm using the angular-auth-oidc-client package to authenticate myself against my Keycloak client. The problem comes after I log into Keycloak with a user, then im getting:

error   "invalid_grant"
error_description   "Code not valid"

here is the config that I am using for the AuthModule

config: {
                authority: [MY KEYCLOAK URL],
                redirectUrl: window.location.origin + '/callback',
                postLogoutRedirectUri: window.location.origin + '/login',
                clientId: [MY CLIENT ID],
                scope: 'openid profile email offline_access',
                responseType: 'code',
                silentRenew: true,
                useRefreshToken: true,
                renewTimeBeforeTokenExpiresInSeconds: 30,
            }

The thing is when I Reload my application im logged in. But then I check my Keycloak session I don't have a client that the user is authenticated in.

for references I have tried to implement this type of setup for my application

Dose anyone know why it behaves like this? I have tried it with a test application and there everything works fine.

CodeBoy361
  • 61
  • 6

0 Answers0