Skip to content
This repository has been archived by the owner on Apr 28, 2020. It is now read-only.

Fix automatic retries when authentication fails #30

Merged
merged 5 commits into from
Oct 31, 2019
Merged

Fix automatic retries when authentication fails #30

merged 5 commits into from
Oct 31, 2019

Conversation

prempador
Copy link
Contributor

@prempador prempador commented Oct 30, 2019

Motivation: Issue #10

  • We know for a fact, that failed Authentication will cause to many follow-up requests
  • We think that the random behavior mentioned in the Issue are caused by expired refresh_tokens the missing space character in the Authenticator class

This PR:

  • Adds logic to the tokenManager, that causes it to retry authentication with API-Key and API-Secret if the authentication with the refresh_token fails
  • Adds logic to the Authenticator, that causes him to give up, if the last request that came back with a 401 error already had an authorization key
  • With 5724599 also adds a Test-Class to prove the changes work as expected

Possible Problems:

  • Authenticator might return null too soon if resfresh_token is expired, need someone to check if this is true This was the case. Changed in f5db52b

@prempador prempador added bug Something isn't working bugfix This fixes a bug and removed bug Something isn't working labels Oct 30, 2019
@pgaubatz pgaubatz merged commit 05dadb1 into fiskaly:master Oct 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bugfix This fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants