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
-
Changelog entry -
Documentation created/updated or follow-up review issue created -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Performance and testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers
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