mirror of https://github.com/jumpserver/jumpserver
fix: when oidc enabled and use_state user login raise 400
parent
e72073f0cc
commit
9cd163c99d
|
@ -107,7 +107,7 @@ class OIDCAuthCodeBackend(OIDCBaseBackend):
|
||||||
# parameters because we won't be able to get a valid token for the user in that case.
|
# parameters because we won't be able to get a valid token for the user in that case.
|
||||||
if (state is None and settings.AUTH_OPENID_USE_STATE) or code is None:
|
if (state is None and settings.AUTH_OPENID_USE_STATE) or code is None:
|
||||||
logger.debug(log_prompt.format('Authorization code or state value is missing'))
|
logger.debug(log_prompt.format('Authorization code or state value is missing'))
|
||||||
raise SuspiciousOperation('Authorization code or state value is missing')
|
return
|
||||||
|
|
||||||
# Prepares the token payload that will be used to request an authentication token to the
|
# Prepares the token payload that will be used to request an authentication token to the
|
||||||
# token endpoint of the OIDC provider.
|
# token endpoint of the OIDC provider.
|
||||||
|
@ -165,7 +165,7 @@ class OIDCAuthCodeBackend(OIDCBaseBackend):
|
||||||
error = "Json token response error, token response " \
|
error = "Json token response error, token response " \
|
||||||
"content is: {}, error is: {}".format(token_response.content, str(e))
|
"content is: {}, error is: {}".format(token_response.content, str(e))
|
||||||
logger.debug(log_prompt.format(error))
|
logger.debug(log_prompt.format(error))
|
||||||
raise ParseError(error)
|
return
|
||||||
|
|
||||||
# Validates the token.
|
# Validates the token.
|
||||||
logger.debug(log_prompt.format('Validate ID Token'))
|
logger.debug(log_prompt.format('Validate ID Token'))
|
||||||
|
@ -206,7 +206,7 @@ class OIDCAuthCodeBackend(OIDCBaseBackend):
|
||||||
error = "Json claims response error, claims response " \
|
error = "Json claims response error, claims response " \
|
||||||
"content is: {}, error is: {}".format(claims_response.content, str(e))
|
"content is: {}, error is: {}".format(claims_response.content, str(e))
|
||||||
logger.debug(log_prompt.format(error))
|
logger.debug(log_prompt.format(error))
|
||||||
raise ParseError(error)
|
return
|
||||||
|
|
||||||
logger.debug(log_prompt.format('Get or create user from claims'))
|
logger.debug(log_prompt.format('Get or create user from claims'))
|
||||||
user, created = self.get_or_create_user_from_claims(request, claims)
|
user, created = self.get_or_create_user_from_claims(request, claims)
|
||||||
|
|
Loading…
Reference in New Issue