Coder Social home page Coder Social logo

Comments (8)

panva avatar panva commented on August 23, 2024 1

Well your callback includes userinfo, so what the function attempts to do is get userinfo with what it received, but your response_type is id_token only. Should be pretty clear you cannot get userinfo with this response_type. Change your verify signature to (tokenset, done) and you're good to go.

from node-openid-client.

m-ermolaev avatar m-ermolaev commented on August 23, 2024 1

@panva with body parser works fine, thanks

from node-openid-client.

panva avatar panva commented on August 23, 2024

Why are you not calling authenticate on the callback route?

app.post('/callback', passport.authenticate('oidc'), ... );

from node-openid-client.

mithun-daa avatar mithun-daa commented on August 23, 2024

I get the following error when I do auth in the callback:

Error: access_token not present in TokenSet
   at Client.userinfo (D:\playground\IdSrvTest\src\node_client\node_modules\openid-client\lib\client.js:492:31)
   at callback.then (D:\playground\IdSrvTest\src\node_client\node_modules\openid-client\lib\passport_strategy.js:106:40)
   at process._tickCallback (internal/process/next_tick.js:103:7)

from node-openid-client.

mithun-daa avatar mithun-daa commented on August 23, 2024

FYI, I am using Identity Server 4 (another OP) and it posts back to my callback and it posts to my app with the following fields in the body:

  id_token: '....',
  scope: 'openid profile',
  state: '...',
  session_state: '...'

from node-openid-client.

mithun-daa avatar mithun-daa commented on August 23, 2024

Awesome! Thank you very much. That did it.

from node-openid-client.

m-ermolaev avatar m-ermolaev commented on August 23, 2024

@panva
Hi! I have almost identical situation. Have this too:

FYI, I am using Identity Server 4 (another OP) and it posts back to my callback and it posts to my app with the following fields in the body:

  id_token: '....',
  scope: 'openid profile',
  state: '...',
  session_state: '...'

But by adding passport.authenticate in my post I get cyclic redirect.

Could you give some tip what can be done ?

from node-openid-client.

panva avatar panva commented on August 23, 2024

do you have a body parser on that path?

from node-openid-client.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.