mirror of https://github.com/doccano/doccano.git
pythondatasetsactive-learningtext-annotationdatasetnatural-language-processingdata-labelingmachine-learningannotation-tool
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
1023 B
20 lines
1023 B
from rest_framework.response import Response
|
|
from rest_framework.views import APIView
|
|
from django.conf import settings
|
|
|
|
class Social(APIView):
|
|
permission_classes = ()
|
|
|
|
def get(self, request, *args, **kwargs):
|
|
return Response({
|
|
'okta': {
|
|
'type': 'oauth2',
|
|
'base_url': settings.SOCIALACCOUNT_PROVIDERS.get('okta').get('OKTA_BASE_URL'),
|
|
'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'
|
|
} if settings.SOCIALACCOUNT_PROVIDERS.get('okta').get('OKTA_BASE_URL') else {},
|
|
})
|