Skip to content
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

Do not retry failed authorization #86

Merged
merged 6 commits into from
Sep 7, 2021
Merged

Conversation

blootsvoets
Copy link
Contributor

Ignore users for future requests if their authentication has failed.

@blootsvoets blootsvoets changed the base branch from master to dev September 6, 2021 14:48
}

@Override
public String getAccessToken(User user) throws IOException, NotAuthorizedException {
if (!user.isAuthorized()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wondering, How would this prevent temporary failures when refreshing tokens being completely removed out of the system? In this case the researchers have to recruit again.

Copy link
Contributor Author

@blootsvoets blootsvoets Sep 7, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, but temporary failures are handled by the rest source authoriser. This update is just to ensure that unauthorised users do not pulled again and again. If the rest source authoriser fails to update a token because it gets a 400, 401 or 403 error from the REST source API (e.g. Fitbit), it will permanently mark the user as unauthorised, until the user is manually authorised again.

@blootsvoets blootsvoets marked this pull request as ready for review September 7, 2021 07:59
Copy link
Contributor

@nivemaham nivemaham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@blootsvoets blootsvoets merged commit 68d29a3 into dev Sep 7, 2021
@blootsvoets blootsvoets deleted the doNotRetryFailedAuthorization branch September 7, 2021 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants