koa access_token missing from session
See original GitHub issueI cloned the examples/koa-session-stores
example, filled in my provider’s details and received the following error, despite the flow working successfully, indicating the the grant
attribute was never added to the session
:
Koa server listening on port 3000
TypeError: Cannot read property 'response' of undefined
at Object.<anonymous> (/private/var/tmp/grant/examples/koa-session-stores/koa-session.js:23:51)
at Generator.next (<anonymous>)
at Object.dispatch (/private/var/tmp/grant/examples/koa-session-stores/node_modules/koa-router/lib/router.js:317:7)
at dispatch.next (<anonymous>)
at Object.allowedMethods (/private/var/tmp/grant/examples/koa-session-stores/node_modules/koa-router/lib/router.js:356:5)
at allowedMethods.next (<anonymous>)
at onFulfilled (/private/var/tmp/grant/examples/koa-session-stores/node_modules/co/index.js:65:19)
at /private/var/tmp/grant/examples/koa-session-stores/node_modules/co/index.js:54:5
at new Promise (<anonymous>)
at Object.co (/private/var/tmp/grant/examples/koa-session-stores/node_modules/co/index.js:50:10)
If I change the transport to querystring
, the access_token
is available in this.query
. The exact same config.json
works with the examples/session-transport
example (which uses express) but I can’t seem to get the access_token
to be properly stored in the session object with the koa-session example. It looks looks like the session object contains only the state, nonce, provider, and expiration. Very possible I’m misunderstanding the docs somewhere along the way.
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Can not get online access token · Issue #20 - GitHub
I have debugged through @shopify/koa-shopify-auth and Shopify returns online accessToken with associated_user and associated_user_scope but @ ...
Read more >CustomSessionStorage using mysql, error missing access token
Solved: Hey, Currently trying to implement a custom session storage using MySQL. After I add the app it throws a missing access token...
Read more >Koa ctx.session lost after redirect - Stack Overflow
Koa ctx.session lost after redirect · Navigate to localhost:8080 (Vue.js server) · Perform login by redirecting to Koa endpoint localhost:8081/api ...
Read more >Authentication and authorization - Apollo GraphQL Docs
Control access to your GraphQL API · Authentication is determining whether a given user is logged in, and subsequently determining which user someone...
Read more >Using the getSession function | SuperTokens Docs
On the other hand, getSession is a function which returns a session object on successful verification, and throws an exception which can be ......
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 FreeTop 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
Top GitHub Comments
Thanks for the feedback, @drvan, this is really helpful! I’ll let you know when the next release is out with the new option to limit the response data in Grant. 👍
Hi @drvan, I’ve published the response option.
Note that by default the
response: 'tokens'
will return all tokens as strings, including theid_token
. That’s the smallest possible response.In case you want to include the decoded
id_token
in the response data you have to useresponse: ['tokens', 'jwt']
.I’ve also pushed an example where I’m demonstrating how easy it is to decode the
id_token
yourself.