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

Use OIDC SSO provider instead of deprecated cern one #239

Merged
merged 1 commit into from
Jul 15, 2023
Merged

Conversation

nothingface0
Copy link
Contributor

@nothingface0 nothingface0 commented Jul 15, 2023

Updating django-allauth config to use the new SSO which is OIDC-based. There was no need to update the cern provider in django-allauth, as the openid_connect adapter works just fine.

See discussion in this django-allauth PR.

Extra steps that have to be done after deploying:

  1. "Migrate" the existing SocialAccount entries as follows:
    1. Run python manage.py shell.
    2. Run:
    from allauth.socialaccount.models import SocialAccount
    sa = SocialAccount.objects.filter(provider="cern")
    for s in sa:
    	if 'username' in s.extra_data:
    		s.uid = s.extra_data["username"]
    		s.save()
  2. Extra env vars that need to be added:
    1. CERN_SSO_REGISTRATION_CLIENT_ID
    2. CERN_SSO_REGISTRATION_CLIENT_SECRET

@codecov-commenter
Copy link

Codecov Report

Merging #239 (078bca4) into develop (91b5665) will decrease coverage by 0.01%.
The diff coverage is 83.33%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@             Coverage Diff             @@
##           develop     #239      +/-   ##
===========================================
- Coverage    69.35%   69.34%   -0.01%     
===========================================
  Files          164      164              
  Lines         5988     5996       +8     
===========================================
+ Hits          4153     4158       +5     
- Misses        1835     1838       +3     
Impacted Files Coverage Δ
users/signals.py 95.31% <78.57%> (-4.69%) ⬇️
users/tests/test_users_signals.py 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@nothingface0 nothingface0 merged commit 908c711 into develop Jul 15, 2023
1 check passed
@nothingface0 nothingface0 deleted the oidc_sso branch July 15, 2023 22:36
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.

2 participants