Skip to content

It's not possible to use newly refreshed access token while the "original" refresh token is still being processed #54289

@azasypkin

Description

@azasypkin

It seems we hit an issue somewhere in a token management subsystem. The issue description is a bit confusion, but here are the steps to reproduce:

  1. Generate access/refresh token pair with a short lifetime (used 15s in my tests)
  2. Wait till access token expires
  3. Simultaneously send two refresh token requests
  4. When first request completes try to use newly refresh token within a request to _authenticate endpoint

It happens so that at the step 4. first refresh request is still in progress and request to _authenticate with newly refreshed token at the same time fails with the following error:

HTTP/1.1 401 Unauthorized (application/json)
WWW-Authenticate: Bearer realm="security"
WWW-Authenticate: ApiKey
WWW-Authenticate: Basic realm="security" charset="UTF-8"

{"error":{"root_cause":[{"type":"security_exception","reason":"missing authentication credentials for REST request [/_security/_authenticate]","header":{"WWW-Authenticate":["Bearer realm="security"","ApiKey","Basic realm="security" charset="UTF-8""]}}],"type":"security_exception","reason":"missing authentication credentials for REST request [/_security/_authenticate]","header":{"WWW-Authenticate":["Bearer realm="security"","ApiKey","Basic realm="security"

/cc @jkakavas

Metadata

Metadata

Assignees

No one assigned

    Labels

    :Security/AuthenticationLogging in, Usernames/passwords, Realms (Native/LDAP/AD/SAML/PKI/etc)>bug

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions