1

I believe it's silly question but how to use node-oidc-provider with express? So I got access_token on the client side, sent request with Bearer {access_token} and what's next? How can I obtain user from that token? I believe oidc-provider must have some middleware or anything which can be used for that but I didn't find any documentation on that topic. The only thing I found is how to check if user is logged in:

const ctx = provider.app.createContext(req, res)
const session = await provider.Session.get(ctx)
const signedIn = !!session.account

But it doesn't work for me and it looks like it's using cookies inside by some reason so session is null in that case.

Andrew
  • 262
  • 4
  • 10

1 Answers1

0

You would make a request to the user_info endpoint using the access token in the authorization header. The url would be should in the .well-known/openid-configuration endpoint of whatever route you attached the provider to.

Deeswoc
  • 159
  • 1
  • 13
  • Thanks for heads up. I created question in github repo, so more details regarding this issue available here: https://github.com/panva/node-oidc-provider/issues/757 – Andrew Dec 02 '20 at 20:19