-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #324 from d120/sso_impl
adding Keycloack
- Loading branch information
Showing
54 changed files
with
940 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ django-debug-toolbar==4.4.6 | |
docutils==0.21.2 | ||
freezegun==1.5.1 | ||
django-formtools==2.5.1 | ||
django-allauth==65.3.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from allauth.socialaccount.adapter import DefaultSocialAccountAdapter | ||
from django.contrib.auth.models import User | ||
from django.conf import settings | ||
|
||
class FeedbackSocialAccountAdapter(DefaultSocialAccountAdapter): | ||
def pre_social_login(self, request, sociallogin): | ||
super().pre_social_login(request, sociallogin) | ||
user = sociallogin.user | ||
|
||
if not user.id: | ||
try : | ||
existing_user = User.objects.get(username=user.username) | ||
sociallogin.connect(request, existing_user) | ||
user = existing_user | ||
except User.DoesNotExist : | ||
user.save() | ||
|
||
user.is_superuser = True | ||
user.is_staff = True | ||
user.save() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Oops, something went wrong.