Merge pull request '# Fix' (#400) from oauth_https_fix into master
Reviewed-on: #400
This commit is contained in:
commit
decf0dc522
@ -18,6 +18,7 @@ from django.utils.timezone import now
|
|||||||
from django.views import View
|
from django.views import View
|
||||||
|
|
||||||
from api.models import OAuthToken
|
from api.models import OAuthToken
|
||||||
|
from konova.sub_settings.django_settings import BASE_URL
|
||||||
from konova.sub_settings.sso_settings import SSO_SERVER_BASE, OAUTH_CODE_VERIFIER, OAUTH_CLIENT_ID, OAUTH_CLIENT_SECRET
|
from konova.sub_settings.sso_settings import SSO_SERVER_BASE, OAUTH_CODE_VERIFIER, OAUTH_CLIENT_ID, OAUTH_CLIENT_SECRET
|
||||||
|
|
||||||
|
|
||||||
@ -62,6 +63,8 @@ class OAuthLoginView(View):
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
oauth_authentication_code_url = f"{SSO_SERVER_BASE}o/authorize/"
|
oauth_authentication_code_url = f"{SSO_SERVER_BASE}o/authorize/"
|
||||||
|
redirect_uri = f'{BASE_URL}{reverse("oauth-callback")}'
|
||||||
|
|
||||||
code_verifier, code_challenge = self.__create_code_challenge()
|
code_verifier, code_challenge = self.__create_code_challenge()
|
||||||
|
|
||||||
urlencode_params = urlencode(
|
urlencode_params = urlencode(
|
||||||
@ -70,11 +73,7 @@ class OAuthLoginView(View):
|
|||||||
"code_challenge": code_challenge,
|
"code_challenge": code_challenge,
|
||||||
"code_challenge_method": "S256",
|
"code_challenge_method": "S256",
|
||||||
"client_id": OAUTH_CLIENT_ID,
|
"client_id": OAUTH_CLIENT_ID,
|
||||||
"redirect_uri": request.build_absolute_uri(
|
"redirect_uri": redirect_uri,
|
||||||
reverse(
|
|
||||||
"oauth-callback"
|
|
||||||
)
|
|
||||||
),
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
url = f"{oauth_authentication_code_url}?{urlencode_params}"
|
url = f"{oauth_authentication_code_url}?{urlencode_params}"
|
||||||
|
Loading…
Reference in New Issue
Block a user