Skip to content

Multiple token refresh issue in AuthenticationInterceptor #3735

Open
@nikolafamit

Description

@nikolafamit

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions