Trying to use with keycloak-passport
See original GitHub issueI have been trying to use next-auth with this keycloak-passport Strategy. (I did have to modify the strategy’s name to be lowercase to be able to test it out)
I can log in no problem and it creates a session. Only problem is, getProfile()
doesn’t seem to fire at all so the session just contains the csrfSecret
but no user. Keycloak recognises I’m already logged in when trying to log in.
Have been trying to debug through what could be happening but couldn’t get to the bottom of it. Any direction on what might be the issue would be great. If I get it working would be happy to submit some documentation on it.
Issue Analytics
- State:
- Created 5 years ago
- Comments:17 (9 by maintainers)
Top Results From Across the Web
Keycloak Passport Strategy - oAuth2/OIDC - GitHub
Keycloak Passport Strategy - oAuth2/OIDC · Use multiple realms in the same application (multi-tenancy) · Use with oAuth2/Open ID Connect 'clients' in keycloak....
Read more >passport-keycloak-bearer - npm
Start using passport-keycloak-bearer in your project by running `npm i passport-keycloak-bearer`. There are 2 other projects in the npm ...
Read more >Passport-keycloak-bearer - npm.io
This module lets you authenticate HTTP requests using bearer tokens with a Keycloak authority in your Node.js applications. Bearer tokens are typically used ......
Read more >Extensions - Keycloak
Passport.js strategy that enables the use of multiple realms in the same application. Python Client. Client library for python ...
Read more >Keycloak Express Openid-client - DEV Community
authenticate('session')); // this creates the strategy passport.use('oidc', new Strategy({client} ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Did you solve this or have a repo that has a basic implementation of nextjs + keycloak?
You welcome! And great yes, lets close this off so it’s easy for anyone to follow if they find it when Googling in case they have the same thing. 😃 Happy to help with the separate log out issue!
The logout button code should be pretty simple, so hopefully won’t involve too much debugging.
You might want to take look at the
handleSignoutSubmit()
function in the nextjs-starter project if it helps. You absolutely don’t need to set the cookie like it does, but it can be nice user behaviour (as it signs them out but keeps them on the same page).