# pip install pysaml2
from saml2.client import Saml2Client
from saml2.config import Config as Saml2Config
metadata_filepath=''
acs_endpoint_url=''
entity_id=''
# 获取跳转网址
saml_settings= {'metadata': {'local': [authenticator_self.metadata_filepath]}, 'service': {'sp': {'endpoints': {'assertion_consumer_service': [(authenticator_self.acs_endpoint_url, 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect'), (authenticator_self.acs_endpoint_url, 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST')]}, 'allow_unsolicited': True, 'authn_requests_signed': False, 'logout_requests_signed': True, 'want_assertions_signed': True, 'want_response_signed': False}}, 'entityid': authenticator_self.entity_id}
spConfig = Saml2Config()
spConfig.load(saml_settings)
spConfig.allow_unknown_attributes = True
saml_client &#
python saml2 认证实例程序demo
于 2021-02-07 00:09:30 首次发布