|
@ -30,6 +30,7 @@ from .connection import ConnectionManager |
|
|
from .exceptions import raise_error_from_response, KeycloakGetError, \ |
|
|
from .exceptions import raise_error_from_response, KeycloakGetError, \ |
|
|
KeycloakRPTNotFound, KeycloakAuthorizationConfigError, KeycloakInvalidTokenError |
|
|
KeycloakRPTNotFound, KeycloakAuthorizationConfigError, KeycloakInvalidTokenError |
|
|
from .urls_patterns import ( |
|
|
from .urls_patterns import ( |
|
|
|
|
|
URL_AUTH, |
|
|
URL_TOKEN, |
|
|
URL_TOKEN, |
|
|
URL_USERINFO, |
|
|
URL_USERINFO, |
|
|
URL_WELL_KNOWN, |
|
|
URL_WELL_KNOWN, |
|
@ -156,9 +157,10 @@ class KeycloakOpenID: |
|
|
|
|
|
|
|
|
:return: |
|
|
:return: |
|
|
""" |
|
|
""" |
|
|
return (self.well_know()['authorization_endpoint'] + |
|
|
|
|
|
'?client_id=' + self.client_id + |
|
|
|
|
|
'&response_type=code&redirect_uri=' + redirect_uri) |
|
|
|
|
|
|
|
|
params_path = {"authorization-endpoint": self.well_know()['authorization_endpoint'], |
|
|
|
|
|
"client-id": self.client_id, |
|
|
|
|
|
"redirect-uri": redirect_uri} |
|
|
|
|
|
return URL_AUTH.format(**params_path) |
|
|
|
|
|
|
|
|
def token(self, username="", password="", grant_type=["password"], code="", redirect_uri=""): |
|
|
def token(self, username="", password="", grant_type=["password"], code="", redirect_uri=""): |
|
|
""" |
|
|
""" |
|
|