-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
How to tell accessToken is set to null? #156
Comments
There isn't an API call to get the token yet, and there isn't one to use a refresh token to get a new access token. Currently folks will need to write their own logic to do this (i.e. look up the user by ID and query the table to get the access token themselves). I would like to support this with A thing that would be helpful in the interim is a document (a short writeup in markdown) that provides an example of creating an I actually have some good reference code for doing this with Google as an example if anyone is interested in that (been using it production for a couple of years with no issues). |
Hmm I don't know. Now there is a (As per comments in that file, it needs refactoring a bit, as the code in there has grown a little wild, but I'm reluctant to get to that too soon as subtle changes can break things for some providers.) |
Thanks! I'm going to be looking at this today. I'm not sure what the problem is, if you have any background on it that would be great. Probably worth raising as a separate issue so can more easily discuss/track progress. |
Update: Both the properties above have now been updated to resolve issues with them for 2.0. I'm not sure why the 'accessToken' would be null on the service, and can't say without having access to debug the calls. It might be appropriate to look at improving debug messages in 2.1 to make it easier to view requests and responses to make debugging issues like this easier. |
@iaincollins Can you point me to your reference code? I'll take a stab at it. |
Oh thanks! It's not an open source project (it's in a private repo of my small company) but sharing the code below! Hopefully makes sense out of context. It looks like I'm using the Google API here, and I think best to create an option for a refresh access REST token endpoint (if needed) instead of pulling in the actual Google API (as pulling in a load of provider specific APIs would bloat the module quite quickly). Not sure if it is endpoint as is used for auth or if it's worthing having a new property in provider profile (that seems like the way to go?)
|
@iaincollins Would it possible to show an example of this in the context of the nextAuth callbacks? I'm thinking that the expiry check and access token fetching can be done in the jwt callback? |
Hi there! It looks like this issue hasn't had any activity for a while. It will be closed if no further activity occurs. If you think your issue is still relevant, feel free to comment on it to keep ot open. Thanks! |
Hi there! It looks like this issue hasn't had any activity for a while. To keep things tidy, I am going to close this issue for now. If you think your issue is still relevant, just leave a comment and I will reopen it. (Read more at #912) Thanks! |
Thanks for the project! I was testing out the new features today.
I was able to get it working with my custom IdentityServer.
On line 172 /src/server/lib/oauthcallback.js the accessToken is set to null. I was wondering why that is set to null?
There are a couple of issues with the model for a mysql database.
My question is how would one go about getting access to original accessToken to make calls to another micro service api? Also, I may have missed it in the documentation how would you refresh the token once it expired?
The text was updated successfully, but these errors were encountered: