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

Add django-allauth for Azure authentication (SSO) and email verification #4163

Merged
merged 115 commits into from
Jan 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
115 commits
Select commit Hold shift + click to select a range
5ea54e4
Add django allauth package
bufke Sep 30, 2022
929021d
configure allauth
bufke Sep 30, 2022
25857e6
Switching from django registration to allauth accounts
bufke Oct 4, 2022
7a21e7e
allauth account templates
bufke Oct 5, 2022
f9be119
Allauth based registration open
bufke Oct 5, 2022
17a470e
MFA password login now works with new accounts app
bufke Oct 6, 2022
315e167
Fix mfa login tests
bufke Oct 6, 2022
9f22887
Fix merge
bufke Oct 7, 2022
7d3962b
Add email verification allauth migration
bufke Oct 7, 2022
6e9ab8b
Move mfa to accounts subdirectory
bufke Oct 7, 2022
607693d
refactor confirmation emails for allauth
JacquelineMorrissette Oct 12, 2022
203e3d0
isort + black
bufke Oct 25, 2022
f1d1444
create kobo superuser should automatically verify the email
bufke Oct 25, 2022
5a349de
fix registration unit tests
JacquelineMorrissette Oct 25, 2022
597c6f0
Merge remote-tracking branch 'origin/django-allauth' into django-allauth
JacquelineMorrissette Oct 25, 2022
e34f181
Merge branch 'accounts-splitup' of github.com:kobotoolbox/kpi into dj…
bufke Nov 21, 2022
b848058
Fix allauth username field validation
bufke Nov 21, 2022
51d80d3
Start emails endpoint
bufke Nov 21, 2022
82bedfd
Merge branch 'beta' of github.com:kobotoolbox/kpi into feature/sso
bufke Nov 28, 2022
f735a91
Adjust CI docker tag for / in git branch
bufke Nov 28, 2022
80eeda3
refactor account settings page
JacquelineMorrissette Nov 29, 2022
88f7231
Apply linting
duvld Nov 30, 2022
8330453
Merge pull request #4166 from kobotoolbox/refactor-accounts-page
bufke Dec 1, 2022
5e26800
Merge branch 'feature/sso' of github.com:kobotoolbox/kpi into feature…
bufke Dec 2, 2022
fa015ac
Fix admin redirect
bufke Dec 2, 2022
c6cafb0
Add email API logic
bufke Dec 2, 2022
8021b44
Send email confirmation when adding new email
bufke Dec 6, 2022
7e1be7f
Add delete to email endpoint
bufke Dec 7, 2022
d540d3b
Make current user api email field read only
bufke Dec 7, 2022
90ec985
Force only 1 confirmed email
bufke Dec 8, 2022
f8d392d
Merge branch 'beta' of github.com:kobotoolbox/kpi into feature/sso
bufke Dec 8, 2022
67c547e
move password component to account security
JacquelineMorrissette Dec 8, 2022
dbfe493
Move API Key component from account profile to account security
p2edwards Dec 8, 2022
b224c01
remove modify password button from account profile
JacquelineMorrissette Dec 8, 2022
b284d1a
Fix change password
bufke Dec 8, 2022
42ac0fe
Merge branch 'feature/sso' of github.com:kobotoolbox/kpi into feature…
bufke Dec 8, 2022
04c0b1e
fix typo in translation string for 2FA
p2edwards Dec 8, 2022
f917d19
Remove queries from email generation, add new email tests
bufke Dec 9, 2022
317a8a3
remove bem from password component
JacquelineMorrissette Dec 9, 2022
2a7c0d4
add sso security component
JacquelineMorrissette Dec 9, 2022
96b117c
initial email changes
duvld Dec 9, 2022
213960d
Merge branch 'feature/sso' into sso-email-rework
duvld Dec 9, 2022
45d5ad2
unfinished text field
duvld Dec 9, 2022
83ad2cc
ugly email section--fetch POST returns 403
duvld Dec 9, 2022
511001e
Update login form scss to match new designs
p2edwards Dec 12, 2022
c2bbd62
Merge branch 'beta' of github.com:kobotoolbox/kpi into feature/sso
bufke Dec 12, 2022
11dbcb7
Make fetch api wrapper
bufke Dec 12, 2022
f6bfd39
Fix missing /
bufke Dec 12, 2022
3142a90
refactor api fetch wrapper
bufke Dec 12, 2022
53ce329
Redirect connect SSO back to security page on success
bufke Dec 13, 2022
50dcb85
Add social identity to current user api
bufke Dec 13, 2022
e800887
Modify login page layout for SSO
p2edwards Dec 13, 2022
4ace6d4
Show sso connected status
bufke Dec 13, 2022
d989adb
Hide the SSO section unless there's an SSO provider. (using css/js)
p2edwards Dec 13, 2022
567a68a
List all SSO providers as labeled buttons if there's more than one. (js)
p2edwards Dec 13, 2022
f791713
MVP styling
duvld Dec 14, 2022
076ce6e
Merge branch 'feature/sso' into sso-email-rework
duvld Dec 14, 2022
5bc4e66
Some styling cleanups
duvld Dec 14, 2022
9d8b2c6
Merge branch 'sso-email-rework' into feature/sso
bufke Dec 14, 2022
c6e00ca
Don't show primary email in verify email message
bufke Dec 14, 2022
6a47aa0
Add disconnect SSO
bufke Dec 14, 2022
5c15e0b
Add fields for social sign up
bufke Dec 15, 2022
abfc326
Add SSO section to registration/signup page. (using css/js)
p2edwards Dec 15, 2022
ebb4ec2
(wip) Extend socialaccount/signup for customization
p2edwards Dec 15, 2022
d79952f
Add template and styles for SSO social signup page
p2edwards Dec 16, 2022
dd82ca3
add activation email
JacquelineMorrissette Dec 16, 2022
e9beebe
(wip) Init socialaccount/login, to be customized
p2edwards Dec 16, 2022
423f8f6
Add minimally styled template for SSO Connect / Sign In pages
p2edwards Dec 16, 2022
246b18c
Update copy for SSO Connect page
p2edwards Dec 16, 2022
963fbb8
Update copy for SSO Sign In page
p2edwards Dec 16, 2022
24f369a
Refactor login and signup to use Django templates
p2edwards Dec 16, 2022
7622574
Remove email from profile page
bufke Dec 16, 2022
6dabc32
Style password reset
bufke Dec 16, 2022
c71f33b
Render the SocialApplication.name in helptext and SSO button labels
p2edwards Dec 16, 2022
15e699b
Style connect/login buttons lighter to indicate connection with SSO
p2edwards Dec 16, 2022
3d757ed
Catch exceptions in get_provider_appname template that fail tests
p2edwards Dec 17, 2022
ec6c539
Remove old email section, refactor passwordSection
duvld Dec 18, 2022
d7522c9
Refactor apiTokenSection
duvld Dec 19, 2022
1399bbe
Refactor mfa section
duvld Dec 19, 2022
8ca7346
Refactor emailSection (no modals still)
duvld Dec 19, 2022
c89ee70
Merge branch 'feature/sso' of https://github.com/kobotoolbox/kpi into…
duvld Dec 19, 2022
cd4fd59
Refactor SSO section (no disable mockups)
duvld Dec 19, 2022
d01248f
fix comment
duvld Dec 19, 2022
02bbc99
don't use navlink on non hash route (ssoSection)
duvld Dec 19, 2022
f9ffbe6
style tweaks
duvld Dec 19, 2022
0486be1
Mention the correct email in verificatoin warning
duvld Dec 19, 2022
139b060
Conditional show sso section
bufke Dec 19, 2022
92d8963
Add field errors on the new registration form, social/signup
p2edwards Dec 20, 2022
9b4c1c3
Merge branch 'feature/sso' of github.com:kobotoolbox/kpi into feature…
bufke Dec 20, 2022
b90ea6f
Improve login
bufke Dec 20, 2022
0dc44a8
Like login, show SSO on signup page only if there's a SocialApp enabled.
p2edwards Dec 20, 2022
9ec077a
add password reset request templates
JacquelineMorrissette Dec 20, 2022
ea0a1cd
Save signup form data
bufke Dec 20, 2022
ef39c1c
Merge branch 'feature/sso' of github.com:kobotoolbox/kpi into feature…
bufke Dec 20, 2022
ca50cc3
Add a social_app response dict entry for CI tests
p2edwards Dec 20, 2022
62940e8
Add (required) label indicators to user metadata based on constance cfg
p2edwards Dec 20, 2022
8549f9e
Redirect /accounts/register to /accounts/signup
p2edwards Dec 20, 2022
0c146ae
Fix scrollbar position and fields being obscured in /account/settings
p2edwards Dec 20, 2022
bd2f042
Migrate extra user profile data to remove any nested values
bufke Dec 21, 2022
0405ec6
run black
bufke Dec 21, 2022
fc6028e
Ignore accounts migration conflicts
bufke Dec 21, 2022
2df8e8a
Save gender/country/sector values only in Django
bufke Dec 21, 2022
0d11e22
Remove test of kludges that were removed
bufke Dec 21, 2022
3624049
change social_apps type to make local tests pass
JacquelineMorrissette Dec 22, 2022
a39eeae
Refine styles on accounts/security
p2edwards Dec 24, 2022
4fe338a
Refine email component
p2edwards Dec 24, 2022
0203db6
Misc cleanup on accounts/security
p2edwards Dec 24, 2022
7749976
Make accounts/confirm-email more generic (account may already exist)
p2edwards Dec 24, 2022
68f678e
Merge branch 'beta' of github.com:kobotoolbox/kpi into feature/sso
bufke Jan 3, 2023
da8a79e
Update allauth
bufke Jan 3, 2023
40fca2b
Add oidc support
bufke Jan 3, 2023
176886e
Remove reflux session store
bufke Jan 3, 2023
9bc9b6b
update create user serializer for EquityTool
JacquelineMorrissette Jan 3, 2023
99f2d30
refactor EqutyTool change
JacquelineMorrissette Jan 5, 2023
ae6f62e
Update $kobo-mid-blue and remove $kobo-light-mid-blue.
p2edwards Jan 9, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
DJANGO_SETTINGS_MODULE: kobo.settings.testing
REDIS_SESSION_URL: redis://localhost:6379
SERVICE_ACCOUNT_BACKEND_URL: redis://localhost:6379/4
CACHE_URL: redis://localhost:6379/3
strategy:
matrix:
python-version: ['3.8', '3.10']
Expand Down
6 changes: 3 additions & 3 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ build:
before_script:
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN registry.gitlab.com
script:
- docker pull $CI_REGISTRY_IMAGE:CI_COMMIT_REF_NAME || true
- docker build --cache-from $CI_REGISTRY_IMAGE:CI_COMMIT_REF_NAME --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME .
- docker pull $CI_REGISTRY_IMAGE:${CI_COMMIT_REF_NAME//\//-} || true
- docker build --cache-from $CI_REGISTRY_IMAGE:${CI_COMMIT_REF_NAME//\//-} --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA --tag $CI_REGISTRY_IMAGE:${CI_COMMIT_REF_NAME//\//-} .
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
- docker push $CI_REGISTRY_IMAGE:${CI_COMMIT_REF_NAME//\//-}

deploy-beta:
stage: deploy
Expand Down
20 changes: 15 additions & 5 deletions dependencies/pip/dev_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ cryptography==37.0.1
# azure-storage-blob
# jwcrypto
# paramiko
# pyjwt
# pyopenssl
cssselect==1.1.0
# via pyquery
Expand All @@ -104,6 +105,7 @@ deepmerge==1.0.1
defusedxml==0.7.1
# via
# djangorestframework-xml
# python3-openid
# pyxform
deprecated==1.2.13
# via
Expand All @@ -119,6 +121,7 @@ django==3.2.15
# via
# -r dependencies/pip/requirements.in
# dj-stripe
# django-allauth
# django-amazon-ses
# django-braces
# django-celery-beat
Expand All @@ -142,6 +145,8 @@ django==3.2.15
# jsonfield
# kobo-service-account
# model-bakery
django-allauth==0.52.0
# via -r dependencies/pip/requirements.in
django-amazon-ses==4.0.1
# via -r dependencies/pip/requirements.in
django-braces==1.15.0
Expand Down Expand Up @@ -184,8 +189,6 @@ django-redis==5.2.0
# via -r dependencies/pip/requirements.in
django-redis-sessions==0.6.2
# via -r dependencies/pip/requirements.in
django-registration-redux==2.10
# via -r dependencies/pip/requirements.in
django-request-cache==1.2
# via -r dependencies/pip/requirements.in
django-reversion==5.0.0
Expand Down Expand Up @@ -394,8 +397,10 @@ pygments==2.12.0
# via
# -r dependencies/pip/requirements.in
# ipython
pyjwt==2.3.0
# via twilio
pyjwt[crypto]==2.3.0
# via
# django-allauth
# twilio
pymongo==3.12.3
# via -r dependencies/pip/requirements.in
pynacl==1.5.0
Expand Down Expand Up @@ -433,6 +438,8 @@ python-dateutil==2.8.2
# -r dependencies/pip/requirements.in
# botocore
# python-crontab
python3-openid==3.2.0
# via django-allauth
pytz==2022.1
# via
# celery
Expand All @@ -455,6 +462,7 @@ requests==2.27.1
# -r dependencies/pip/requirements.in
# azure-core
# coveralls
# django-allauth
# django-oauth-toolkit
# google-api-core
# google-cloud-storage
Expand All @@ -466,7 +474,9 @@ requests==2.27.1
# twilio
# yubico-client
requests-oauthlib==1.3.1
# via msrest
# via
# django-allauth
# msrest
responses==0.20.0
# via -r dependencies/pip/requirements.in
rsa==4.8
Expand Down
2 changes: 1 addition & 1 deletion dependencies/pip/requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ celery[redis]
dict2xml
dj-static
dj-stripe
django-allauth
django-braces
django-celery-beat
django-constance[database]
Expand All @@ -38,7 +39,6 @@ django-extensions
django-oauth-toolkit
django-organizations
django-redis
django-registration-redux
django-storages[azure,boto3]
django-amazon-ses
django-webpack-loader
Expand Down
20 changes: 15 additions & 5 deletions dependencies/pip/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ cryptography==37.0.1
# via
# azure-storage-blob
# jwcrypto
# pyjwt
# pyopenssl
cssselect==1.1.0
# via pyquery
Expand All @@ -83,6 +84,7 @@ deepmerge==1.0.1
defusedxml==0.7.1
# via
# djangorestframework-xml
# python3-openid
# pyxform
deprecated==1.2.13
# via
Expand All @@ -98,6 +100,7 @@ django==3.2.15
# via
# -r dependencies/pip/requirements.in
# dj-stripe
# django-allauth
# django-amazon-ses
# django-braces
# django-celery-beat
Expand All @@ -120,6 +123,8 @@ django==3.2.15
# djangorestframework
# jsonfield
# kobo-service-account
django-allauth==0.52.0
# via -r dependencies/pip/requirements.in
django-amazon-ses==4.0.1
# via -r dependencies/pip/requirements.in
django-braces==1.15.0
Expand Down Expand Up @@ -162,8 +167,6 @@ django-redis==5.2.0
# via -r dependencies/pip/requirements.in
django-redis-sessions==0.6.2
# via -r dependencies/pip/requirements.in
django-registration-redux==2.10
# via -r dependencies/pip/requirements.in
django-request-cache==1.2
# via -r dependencies/pip/requirements.in
django-reversion==5.0.0
Expand Down Expand Up @@ -325,8 +328,10 @@ pycparser==2.21
# via cffi
pygments==2.12.0
# via -r dependencies/pip/requirements.in
pyjwt==2.3.0
# via twilio
pyjwt[crypto]==2.3.0
# via
# django-allauth
# twilio
pymongo==3.12.3
# via -r dependencies/pip/requirements.in
pyopenssl==22.0.0
Expand All @@ -350,6 +355,8 @@ python-dateutil==2.8.2
# -r dependencies/pip/requirements.in
# botocore
# python-crontab
python3-openid==3.2.0
# via django-allauth
pytz==2022.1
# via
# celery
Expand All @@ -371,6 +378,7 @@ requests==2.27.1
# via
# -r dependencies/pip/requirements.in
# azure-core
# django-allauth
# django-oauth-toolkit
# google-api-core
# google-cloud-storage
Expand All @@ -382,7 +390,9 @@ requests==2.27.1
# twilio
# yubico-client
requests-oauthlib==1.3.1
# via msrest
# via
# django-allauth
# msrest
responses==0.20.0
# via -r dependencies/pip/requirements.in
rsa==4.8
Expand Down
26 changes: 0 additions & 26 deletions hub/views.py

This file was deleted.

27 changes: 4 additions & 23 deletions jsapp/js/account/accountSettings.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
background: colors.$kobo-white;
overflow-y: auto;
position: relative;
padding: sizes.$x50;
padding-top: sizes.$x50;

h4 {
margin: 0;
Expand All @@ -29,35 +29,16 @@
.form-modal__item--fields {
height: calc(100% - #{sizes.$x50});
padding-right: 40px;
padding-left: sizes.$x50;
padding-bottom: sizes.$x30;
overflow: auto;

> *:last-child {margin-bottom: 20px;}
}

.form-modal__item--api-token {
display: flex;
flex-direction: row;
align-items: center;
flex-wrap: wrap;

> label {
width: 100%;
}

.text-box {
display: inline-block;
vertical-align: top;
width: 50%;
margin-right: sizes.$x5;

.text-box__input {
font-family: mdl.$font_mono;
}
}
}

.form-modal__item--username {
min-height: 32px;
padding-left: sizes.$x50;

.account-box__initials {
display: inline-block;
Expand Down
Loading