|
@ -174,17 +174,25 @@ class KeycloakOpenID: |
|
|
|
|
|
|
|
|
return raise_error_from_response(data_raw, KeycloakGetError) |
|
|
return raise_error_from_response(data_raw, KeycloakGetError) |
|
|
|
|
|
|
|
|
def auth_url(self, redirect_uri): |
|
|
|
|
|
|
|
|
def auth_url(self, redirect_uri, scope="email", state=""): |
|
|
""" |
|
|
""" |
|
|
|
|
|
Get authorization URL endpoint. |
|
|
|
|
|
|
|
|
http://openid.net/specs/openid-connect-core-1_0.html#AuthorizationEndpoint |
|
|
|
|
|
|
|
|
|
|
|
:return: |
|
|
|
|
|
|
|
|
: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 = { |
|
|
params_path = { |
|
|
"authorization-endpoint": self.well_known()["authorization_endpoint"], |
|
|
"authorization-endpoint": self.well_known()["authorization_endpoint"], |
|
|
"client-id": self.client_id, |
|
|
"client-id": self.client_id, |
|
|
"redirect-uri": redirect_uri, |
|
|
"redirect-uri": redirect_uri, |
|
|
|
|
|
"scope": scope, |
|
|
|
|
|
"state": state, |
|
|
} |
|
|
} |
|
|
return URL_AUTH.format(**params_path) |
|
|
return URL_AUTH.format(**params_path) |
|
|
|
|
|
|
|
|