Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JWT refresh tokens #196

Open
benjie opened this issue Feb 17, 2020 · 0 comments
Open

JWT refresh tokens #196

benjie opened this issue Feb 17, 2020 · 0 comments

Comments

@benjie
Copy link
Member

benjie commented Feb 17, 2020

Per @BowlingX:

I implemented it, although I would say this is out of scope of postgraphile. I'm using an apollo middleware to detect expired JWT tokens, then I refresh the token and replay the request (this way the user does not realize anything)
I'm using keycloak as my identity management and just have a verification middleware in front of postgraphile (as explained in the docs)
I use passport-oauth2-refresh on nodejs side
https://gist.github.com/BowlingX/356e6cdf071aeee97f842dd9e12d5c53

Then I have this error handler in apollo on ssr side: https://gist.github.com/BowlingX/33ab1c448f6b635769083aece1ba875d

And this one on the frontend error link: https://gist.github.com/BowlingX/1a9d7971bb31b4aab70680ab5a067e6b

-- https://discordapp.com/channels/489127045289476126/498852330754801666/678953091839819777

@BowlingX plans to write an example app or guide for the website

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant