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

Feature request: Support Gitlab OAuth #5771

Open
ssssam opened this issue Jul 16, 2024 · 3 comments
Open

Feature request: Support Gitlab OAuth #5771

ssssam opened this issue Jul 16, 2024 · 3 comments

Comments

@ssssam
Copy link
Contributor

ssssam commented Jul 16, 2024

Currently openQA can't handle the OAuth user info returned from GitLab.

GitLab returns the user id in a field named sub, while openQA expects it to be in a field named id.

GitLab is complying with the OpenID Connect core 1.0 spec, see: section 5.1. So it looks like openQA should perhaps accept sub as an alternative to id.

GitLab docs: https://docs.gitlab.com/ee/integration/openid_connect_provider.html

@okurz
Copy link
Member

okurz commented Jul 16, 2024

https://openqa.debian.net/ authenticates using gitlab. Can you check why that works for Debian but not for you?

@ssssam
Copy link
Contributor Author

ssssam commented Jul 17, 2024

Sure. I guess Phil Hands is the person to speak to.

@phil-hands
Copy link
Contributor

The currently working config snippet from openqa.debian.net's /etc/openqa/openqa.ini is:

## Authentication method to use for user management
[auth]
# method = Fake|OpenID|OAuth2
method = OAuth2

#for salsa.debian.org one can use:
[oauth2]
provider = debian_salsa
key = ...
secret = ...

which relies on the presence of this change, which has since been merged upstream.

Note that there is also this comment in openqa.ini, which is based on what I used to do before I patched the mojo plugin to know about debian_salsa as a provider, so should demonstrate how to point things at some other gitlab instance:

# alternatively, one can specify parameters manually without relying on magic a provider name:
#[oauth2]
#provider = custom
#unique_name = debian_salsa
#key = ...
#secret = ...
#authorize_url = https://salsa.debian.org/oauth/authorize?response_type=code
#token_url = https://salsa.debian.org/oauth/token
#user_url  = https://salsa.debian.org/api/v4/user
#token_scope = read_user
#token_label = Bearer
#nickname_from = username

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants