def validate_idp(idp, protocol, assertion):
 remote_id_parameter = get_remote_id_parameter(protocol)
 if ((not remote_id_parameter) or (not idp['remote_ids'])):
  LOG.debug('Impossible to identify the IdP %s ', idp['id'])
  return
 try:
  idp_remote_identifier = assertion[remote_id_parameter]
 except KeyError:
  msg = _('Could not find Identity Provider identifier in environment')
  raise exception.ValidationError(msg)
 if (idp_remote_identifier not in idp['remote_ids']):
  msg = _('Incoming identity provider identifier not included among the accepted identifiers.')
  raise exception.Forbidden(msg)

def validate_idp ( idp , protocol , assertion ) : remote_id_parameter = get_remote_id_parameter ( protocol ) if ( ( not remote_id_parameter ) or ( not idp [ 'remote_ids' ] ) ) : LOG . debug ( 'Impossible to identify the IdP %s ' , idp [ 'id' ] ) return try : idp_remote_identifier = assertion [ remote_id_parameter ] except KeyError : msg = _ ( 'Could not find Identity Provider identifier in environment' ) raise exception . ValidationError ( msg ) if ( idp_remote_identifier not in idp [ 'remote_ids' ] ) : msg = _ ( 'Incoming identity provider identifier not included among the accepted identifiers.' ) raise exception . Forbidden ( msg )
the idp providing the assertion should be registered for the mapping .