def get_authn_request( self, template=AuthnRequest, **parameters, ): """ Make a AuthnRequest to send to this IdP. """ return template({ 'REQUEST_ID': get_random_id(), 'ISSUE_INSTANT': self.format_datetime(utcnow()), 'DESTINATION': self.get_idp_sso_url(), 'ISSUER': self.sp.get_sp_entity_id(), 'ACS_URL': self.get_sp_acs_url(), **parameters, })
def get_logout_request( self, auth_data: AuthData, template: XmlTemplate = LogoutRequest, **parameters, ): """ Make a LogoutRequest for the authenticated user to send to this IdP. """ return template({ 'REQUEST_ID': get_random_id(), 'ISSUE_INSTANT': self.format_datetime(utcnow()), 'DESTINATION': self.get_idp_slo_url(), 'ISSUER': self.sp.get_sp_entity_id(), 'SUBJECT': auth_data.nameid, 'SUBJECT_FORMAT': auth_data.nameid_format, **parameters, })
def get_response_id(self): """Generate an ID for the response.""" return get_random_id()
def get_assertion_id(self): """Generates an ID for this assertion.""" return get_random_id()