Conversation
errors from django_openid_auth to django-oauth-toolkit
|
@copilot the new workflow should still rely on the SSO provided by login.ubuntu.com, as before. |
Reworked in f851b5f. The authentication flow now uses login.ubuntu.com as the OIDC provider:
OIDC endpoint URLs default to |
errors from django_openid_auth to django-oauth-toolkiterrors from django_openid_auth to django-oauth-toolkit with login.ubuntu.com OIDC SSO
| @@ -0,0 +1,149 @@ | |||
| import logging | |||
There was a problem hiding this comment.
@copilot don't re-implement oidc yourself, but just make use of django-oauth-toolkit, and configure it appropriately use login.ubuntu.com as the OIDC provider.
There was a problem hiding this comment.
Replaced in dadd9f6. Removed the custom oidc.py entirely and switched to mozilla-django-oidc — a standard Django OIDC client library that handles the full authorization code flow (login redirect, callback, token exchange, userinfo) out of the box.
django-oauth-toolkit is an OIDC provider library (for building an auth server), so it can't act as an OIDC client for login.ubuntu.com. mozilla-django-oidc is the direct OIDC replacement for django_openid_auth — it's a client/RP library purpose-built for authenticating users via an external OIDC provider.
The only custom code is backends.py — a small OIDCAuthenticationBackend subclass that handles Launchpad team-to-group mapping (same logic as the original OPENID_LAUNCHPAD_TEAMS_MAPPING). All OIDC protocol handling is delegated to the library.
errors from django_openid_auth to django-oauth-toolkit with login.ubuntu.com OIDC SSOerrors from django_openid_auth to mozilla-django-oidc with login.ubuntu.com OIDC SSO
|
@copilot |
Switched to The integration is minimal —
Launchpad team-to-group mapping is dropped per follow-up guidance. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
errors from django_openid_auth to mozilla-django-oidc with login.ubuntu.com OIDC SSOerrors from django_openid_auth to python-social-auth with Launchpad backend
…ckend Replace the deprecated django_openid_auth with social-auth-app-django using the built-in LaunchpadOpenId backend. This uses python-social-auth's standard OpenID flow with login.launchpad.net. - settings.py: OpenIDBackend → LaunchpadOpenId, social_django in INSTALLED_APPS, removed all OPENID_* settings and team mapping, LOGIN_URL → /login/launchpad/, error URL → /login-failed - urls.py: mount social_django.urls at /login/ - config.py: remove openid_trust_root (not needed) - pyproject.toml: add social-auth-app-django>=5.0.0 Co-authored-by: Hyask <7489759+Hyask@users.noreply.github.com>
2971511 to
e26e5bf
Compare
e26e5bf to
6147b9f
Compare
django_openid_authis deprecated. Replace it withpython-social-auth(social-auth-app-django), which provides a built-inLaunchpadOpenIdbackend that handles authentication vialogin.launchpad.netout of the box.Changes
settings.py:OpenIDBackend→LaunchpadOpenId,social_djangoinINSTALLED_APPS, allOPENID_*settings removed,LOGIN_URL→/login/launchpad/,SOCIAL_AUTH_LOGIN_ERROR_URL→/login-failedurls.py:social_django.urlsmounted at/login/(provides/login/launchpad/and/login/complete/launchpad/), removed stale commented-outdjango_openid_authURLconfig.py: Removed unusedopenid_trust_rootsettingpyproject.toml: Addedsocial-auth-app-django>=5.0.0to dev depsRemoved
OPENID_*settings (no longer needed)OPENID_LAUNCHPAD_TEAMS_MAPPING(Launchpad team-to-group mapping dropped)openid_trust_rootfromconfig.pybackends.pyandoidc.pyfrom previous iterationsUnchanged
auth.pygroup-based authorization (@can_see_stacktraces) — uses Django groups, backend-agnosticlogout_view/login_failedviewscontext_processors.py— builds login URL fromsettings.LOGIN_URLindex.html— login.ubuntu.com profile link preservedDeployment note
No special configuration is required beyond installing the
social-auth-app-djangopackage and running migrations forsocial_django. TheLaunchpadOpenIdbackend authenticates users vialogin.launchpad.netusing OpenID 2.0 without needing client credentials.Original prompt
errorsto usingdjango-oauth-toolkit#13✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.