Browse Source

fix lint issue

pull/2079/head
Clovin 2 years ago
parent
commit
46afe80207
2 changed files with 6 additions and 3 deletions
  1. 1
      backend/social/okta.py
  2. 8
      backend/social/views.py

1
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'

8
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 {},
})
Loading…
Cancel
Save