diff --git a/backend/social/okta.py b/backend/social/okta.py index aa14c52d..d6fd3b2b 100644 --- a/backend/social/okta.py +++ b/backend/social/okta.py @@ -2,6 +2,7 @@ from allauth.socialaccount.providers.okta.views import OktaOAuth2Adapter from dj_rest_auth.registration.views import SocialLoginView from allauth.socialaccount.providers.oauth2.client import OAuth2Client + class OktaLogin(SocialLoginView): adapter_class = OktaOAuth2Adapter callback_url = '/projects' diff --git a/backend/social/views.py b/backend/social/views.py index 15e85ce6..ec275089 100644 --- a/backend/social/views.py +++ b/backend/social/views.py @@ -2,6 +2,7 @@ from rest_framework.response import Response from rest_framework.views import APIView from django.conf import settings + class Social(APIView): permission_classes = () @@ -13,8 +14,9 @@ class Social(APIView): 'client_id': settings.SOCIALACCOUNT_PROVIDERS.get('okta').get('APP').get('client_id'), 'redirect_path': '/social/complete/okta-oauth2', 'authorize_url': - 'https://' + settings.SOCIALACCOUNT_PROVIDERS.get('okta').get('OKTA_BASE_URL') + - '/oauth2/v1/authorize?response_type=code&client_id=' + settings.SOCIALACCOUNT_PROVIDERS.get('okta').get('APP').get('client_id') + - '&scope=openid&state=unknown&response_mode=form_post' + 'https://' + settings.SOCIALACCOUNT_PROVIDERS.get('okta').get('OKTA_BASE_URL') + + '/oauth2/v1/authorize?response_type=code&client_id=' + + settings.SOCIALACCOUNT_PROVIDERS.get('okta').get('APP').get('client_id') + + '&scope=openid&state=unknown&response_mode=form_post', } if settings.SOCIALACCOUNT_PROVIDERS.get('okta').get('OKTA_BASE_URL') else {}, })