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

Migrate authentication to OIDC #4387

Merged
merged 6 commits into from
Mar 3, 2022
Merged

Migrate authentication to OIDC #4387

merged 6 commits into from
Mar 3, 2022

Conversation

abompard
Copy link
Member

This is a gigantic pull request, please look at the commits one after the other.

This add support authentication for OpenID Connect authentication in the server in addition to OpenID. The old OpenID authentication can be accessed by using /login?method=openid as the login URL.

The bodhi client is switched to OIDC entirely, plain OpenID support has been dropped.
Depending on the OIDC provider's capabilities, users may have to run the bodhi client on a host that has a browser.
Hopefully Fedora's OIDC provider (Ipsilon) will soon be updated to enable the OOB feature, that lets user just copy and paste the authentication code from their login browser window to the bodhi client, wherever it runs. See the OOB feature request.

Fixes: #1180, #4356

@abompard abompard requested a review from a team as a code owner February 16, 2022 16:32
@abompard abompard force-pushed the oidc branch 8 times, most recently from 4369cfc to 477a701 Compare February 17, 2022 16:16
@abompard
Copy link
Member Author

Well well well, it looks like authlib 1.0rc1 has changed the API a bit, and we want to be compatible with 1.0 when it's out, so I'll make some additional changes to support it.

@ppolakov ppolakov linked an issue Feb 23, 2022 that may be closed by this pull request
@abompard abompard force-pushed the oidc branch 15 times, most recently from d9f28f8 to e8de42e Compare March 2, 2022 11:30
We're using authlib to handle most of the OpenID Connect workflow.

The login and logout views have been moved to the `bodhi.server.auth`
module.

The old OpenID authentication can be accessed by using
`/login?method=openid` as the login URL.

The OIDC support has been split into two modules:
- `oauth.py`, which contains the Pyramid integration of Authlib, and has
  nothing specific to Fedora (this should be sent to Authlib upstream
  to add Pyramid integration to Authlib)
- `fedora.py` which contains the Fedora-specific (actually
  Ipsilon-specific) extensions.

Signed-off-by: Aurélien Bompard <aurelien@bompard.org>
abompard added 5 commits March 3, 2022 08:12
The implementation uses the authlib integration for `requests`.

There are two modes for authentication, depending on the OIDC provider's
capability to do OOB (Out Of Band).

If the provider cannot do OOB, it will spawn a temporary HTTP server to
receive the redirect, so it only works if bodhi-client is running in the
same machine as the browser.

Signed-off-by: Aurélien Bompard <aurelien@bompard.org>
The hard part is to register bodhi-client and bodhi-server with Ipsilon,
and to distribute Ipsilon's self-signed certificate to the bodhi
container.

Signed-off-by: Aurélien Bompard <aurelien@bompard.org>
Signed-off-by: Aurélien Bompard <aurelien@bompard.org>
Signed-off-by: Aurélien Bompard <aurelien@bompard.org>
Signed-off-by: Aurélien Bompard <aurelien@bompard.org>
@mergify mergify bot merged commit 4490c9b into fedora-infra:develop Mar 3, 2022
@abompard abompard deleted the oidc branch March 3, 2022 08:09
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

Successfully merging this pull request may close these issues.

Move away from pyramid_fas_openid and python-openid Implement OpenID Connect
3 participants