auth-module: Nuxt auth does not make a request after receiving pkce_code_verifier
Hello, I have a problem when using @ nuxt / auth, I use it to interact with keycloak openID, with my settings. After I have passed the authorization, I am thrown to my page with pkce_code_verifier, but auth does not make a request to get tokens, if I do it manually with this code, then I will get tokens. What am I doing wrong, please tell me
auth: {
strategies: {
keycloak: {
scheme: 'oauth2',
endpoints: {
authorization: 'http://localhost:8080/auth/realms/test/protocol/openid-connect/auth',
token: 'http://localhost:8080/auth/realms/test/protocol/openid-connect/token',
logout: 'http://localhost:8080/auth/realms/test/protocol/openid-connect/logout'
},
token: {
property: 'access_token',
type: 'Bearer',
maxAge: 1800
},
refreshToken: {
property: 'refresh_token',
maxAge: 60 * 60 * 24 * 30
},
responseType: 'code',
accessType: 'offline',
grantType: 'authorization_code',
redirectUri: 'http://localhost:800/callback',
logoutRedirectUri: undefined,
clientId: 'new-auth-test',
scope: ['openid', 'profile', 'email'],
state: 'UNIQUE_AND_NON_GUESSABLE',
codeChallengeMethod: 'S256',
}
}
},
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 1
- Comments: 27
I fought with this same problem for a while, in the end for me what fixed it was missing the redirect object inside the auth.
Just to add we never got this to work with auth-next@5.0.0-1637745161 either, the redirect URL with code and state params just never calls the token URL (or any other). Of the above suggestions neither changing the order of module imports nor adding the redirects in the auth config helped.
I tried to do everything without using the object, it was a typo after the trial, sorry that I did not correct it immediately. I also used an empty redirect, but it still works the same way. Thanks for the typo, I corrected it)