-
Notifications
You must be signed in to change notification settings - Fork 115
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
First functionality for refresh tokens (Android + iOS) #60
First functionality for refresh tokens (Android + iOS) #60
Conversation
call.reject(ERR_GENERAL, ex); | ||
} else { | ||
if (response1 != null) { | ||
if (oauth2Options.getResourceUrl() != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this part (resourceUrl) is not needed for just refreshing a token, right?
@@ -245,28 +312,28 @@ protected void handleOnActivityResult(int requestCode, int resultCode, Intent da | |||
try { | |||
tokenExchangeRequest = response.createTokenExchangeRequest(); | |||
this.authService.performTokenRequest(tokenExchangeRequest, (response1, ex) -> { | |||
authState.update(response1, ex); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just formatting here, no code changes
When leaving the app idle for 1 hour (token expiry time), the authState becomes null (as it's only set in the authenticate method). Added some code to set the authState in case it's empty (just like in the authenticate method).
@dennisameling Are you finished with this. I don't know when I have the time to review and test it but I can add it to my todo list ;) |
@moberwasserlechner sorry for the late reply! Android + iOS are done, we've started using those in a production application (~100 users) last week and it's been working flawlessly. 👍 I just removed the PWA code, as it was incomplete. If we were to use the implicit flow for refreshing tokens, it would involve creating an iFrame to refresh the token without user interaction. The angular-oauth2-oidc library also uses iFrames for refreshing tokens, so we could take inspiration from that. Let's discuss the ideas/strategy for PWA further in #59 😃, then this PR would just be for Android + iOS. |
Thx |
First commit for #59