-
Notifications
You must be signed in to change notification settings - Fork 232
okta-react: Adds function refreshTokens to Auth.js #181
Conversation
… tokens without redirect Fixes okta#180
Hi, @mschaeffner this is a great PR, I need this functionality. Could you update the documentation on where is the best place to use it? If possible do you an ETA on when this feature will be available? |
Hi @mschaeffner @sabs231 - help me understand the story that this is useful for? I'm curious because the underlying Auth JS library does try to do the silent refresh for you. Unfortunatley we do have a race condition where it will fail sometimes (see okta/okta-auth-js#92 (comment) , we're going to work on this soon). I'm just curious to know if that's the issue you're running into, of if there is another use case where you need to manually refresh the tokens? |
I already had a look into the the underlying This leads to a situation, that there is a time frame in which my application doesn't have a valid token. Then I will get a 401 response when I try to fetch data from my API, because the token already expired. A 401 response will redirect the user to the login screen. And the requirement for my application is that this must never ever happen. The application must run for months without forcing the user to re-authenticate. So I opened this pull request, that as a developer I have more control over the token refresh logic and I can better integrate it into my application logic and requirements. @robertjd, if you think the logic for a token refresh should be in the underlying Auth JS lib, that's fine with me. But then we need a way to configure it here in |
Thanks @mschaeffner , knowing that helps. The change I want to see it that |
If you implement |
@robertjd We're also experiencing this issue, and your approach feels like the right one. Would love to see this prioritized. |
Hi all, we've implemented the changes that were discussed in this thread. Please update to |
to obtain new tokens without a redirect
Fixes #180