Closed shaozi closed 1 year ago
You probably should check for errors first
errors = auth.get_errors()
if errors:
error_reason = auth.get_last_error_reason()
raise ValueError(f'{error_reason} {"".join(errors)}')
@shaozi , as @kotofos suggested, those attributes are only available if the SAML Response was valid, if you are directly using the OneLogin_Saml2_Auth object.
See process_response
The methods
get_session_expiration
andget_last_assertion_not_on_or_after
ofOneLogin_Saml2_Auth
returnsNone
instead of the value inNotOnOrAfter
: