|
|
@ -67,6 +67,7 @@ class KeycloakOpenID: |
|
|
|
:param verify: True if want check connection SSL |
|
|
|
:param custom_headers: dict of custom header to pass to each HTML request |
|
|
|
:param proxies: dict of proxies to sent the request by. |
|
|
|
:param timeout: connection timeout in seconds |
|
|
|
""" |
|
|
|
|
|
|
|
def __init__( |
|
|
@ -183,17 +184,24 @@ class KeycloakOpenID: |
|
|
|
data_raw = self.connection.raw_get(URL_WELL_KNOWN.format(**params_path)) |
|
|
|
return raise_error_from_response(data_raw, KeycloakGetError) |
|
|
|
|
|
|
|
def auth_url(self, redirect_uri): |
|
|
|
"""Get the authentication URL endpoint. |
|
|
|
|
|
|
|
http://openid.net/specs/openid-connect-core-1_0.html#AuthorizationEndpoint |
|
|
|
|
|
|
|
:return: |
|
|
|
def auth_url(self, redirect_uri, scope="email", state=""): |
|
|
|
"""Get authorization URL endpoint. |
|
|
|
|
|
|
|
:param redirect_uri: Redirect url to receive oauth code |
|
|
|
:type redirect_uri: str |
|
|
|
:param scope: Scope of authorization request, split with the blank space |
|
|
|
:type: scope: str |
|
|
|
:param state: State will be returned to the redirect_uri |
|
|
|
:type: str |
|
|
|
:returns: Authorization URL Full Build |
|
|
|
:rtype: str |
|
|
|
""" |
|
|
|
params_path = { |
|
|
|
"authorization-endpoint": self.well_known()["authorization_endpoint"], |
|
|
|
"client-id": self.client_id, |
|
|
|
"redirect-uri": redirect_uri, |
|
|
|
"scope": scope, |
|
|
|
"state": state, |
|
|
|
} |
|
|
|
return URL_AUTH.format(**params_path) |
|
|
|
|
|
|
|