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

Multiple token refresh issue in AuthenticationInterceptor #3735

Open
1 task done
nikolafamit opened this issue Jun 7, 2023 · 1 comment
Open
1 task done

Multiple token refresh issue in AuthenticationInterceptor #3735

nikolafamit opened this issue Jun 7, 2023 · 1 comment
Assignees

Comments

@nikolafamit
Copy link

What did you do?

ℹ Replaced private and public keys for JWT token (on the server).
Before that everything was working as it should be and it's working fine for different host. It's just not working on the host where we changed public and private keys for JWT.

What did you expect to happen?

ℹ Alamofire request will attach Authorization token in request header

What happened instead?

ℹ Authenticator "func refresh" triggered 5 times (with success response with token) and after that triggered next API call without authorization header and response of that call is:
Alamofire.AFError.requestAdaptationFailed(error: Alamofire.AuthenticationError.excessiveRefresh)

Alamofire Environment

**Alamofire Version:**5.4.3
**Dependency Manager:**Pod
**Xcode Version:**14.3.1
**Swift Version:**5.8.1
Platform(s) Running Alamofire: iOS
**macOS Version Running Xcode:**Ventura 13.4

Demo Project

ℹ Please link to or upload a project we can download that reproduces the issue.

@jshier
Copy link
Contributor

jshier commented Jul 21, 2023

Sorry, there's not enough here for us to investigate. It sounds like you're using the AuthenticationInterceptor and changed how authentication works, so it's likely you need to update some of your other logic for detecting auth errors or detecting that the credential is attached to the request. I suggest you investigate further and, if you can't solve it, attach your AuthenticationInterceptor implementation or a reproducible project so we can better investigate what's going on.

@jshier jshier self-assigned this Jul 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants