Do not do provider reauthentication without refresh_token #1217
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #1218
There can be scenarios where the provider doesn't return refresh token due to missing scopes (see #1215). In those cases the user is prompted to enter local password, then the broker tries to reauthenticate, which of couse fails and the user has to again go through the whole long authentication cycle from the beginning and get a new access token.
In such scenarios, we should not do a token refresh with provider unless
force_provider_authenticationis explicitly set.If a user has the access token (and not refresh token), we should let them in till that token expires. I understand that reauthentication is needed to ensure a user still has access or not. But if the broker failed to get the refresh token earlier and the admin has not enfored the provider authentication on every login, I think it is okay if the user still gets access using local password.
We anyways allow the same if the machine is offline.