question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Trying to use with keycloak-passport

See original GitHub issue

I 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:closed
  • Created 5 years ago
  • Comments:17 (9 by maintainers)

github_iconTop GitHub Comments

5reactions
thebetterjortcommented, Feb 26, 2019

Did you solve this or have a repo that has a basic implementation of nextjs + keycloak?

1reaction
iaincollinscommented, Aug 11, 2018

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).

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found