Skip to content

Resolve "OAuth2 support with GitLab personal access token"

What does this MR do?

Updates the access token logic in user_auth_finders.rb to allow Personal Access Tokens (PATs) to be accepted with the header Authentication: Bearer #{personal_access_token} in order to be fully compliant with the OAuth2 spec and allow OAuth2 support for PATs. This will allow users to make OAuth compliant requests using PATs while also having 2FA enabled. A specific example is this will allow users to publish to the NPM registry while using 2FA (see #9140).

Does this MR meet the acceptance criteria?

Conformity

Performance and testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team

Related: https://gitlab.com/gitlab-org/gitlab-ee/issues/9140 Directly Related: #63438 (closed)

Edited by Steve Abrams

Merge request reports