我正在努力理解如何配置pysaml2并在请求中添加AuthnContext。 我有一个SP,当客户端执行登录请求时,我需要添加以下请求:
<samlp:RequestedAuthnContext>
<saml:AuthnContextClassRef>
urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport
</saml:AuthnContextClassRef>
</samlp:RequestedAuthnContext>
我在挣扎,因为我尽了我所能,我相信在我的请求中加入这一点是可能的,因为在这里https://github.com/IdentityPython/pysaml2/blob/master/src/saml2/samlp.py
我可以看到:
AUTHN_PASSWORD = "urn:oasis:names:tc:SAML:2.0:ac:classes:Password"
AUTHN_PASSWORD_PROTECTED = \
"urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport"
我只是不知道如何引用这个。。我有这样一个简单的配置:
"service": {
"sp": {
"name": "BLABLA",
"allow_unsolicited": true,
"want_response_signed": false,
"logout_requests_signed": true,
"endpoints": {
"assertion_consumer_service": ["https://mywebste..."],
"single_logout_service": [["https://mywebste...", "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"]]
},
"requestedAuthnContext" : true
}
}
有人知道如何添加上述配置吗? 我很难理解如何构建配置字典,即使是通过阅读他们的文档。有什么想法吗? 如果配置不允许,我很乐意在代码中直接添加“PasswordProtectedTransport”。。但我不知道怎么做
谢谢, R
在某个时刻,您的客户机调用),
或
create_authn_request(...)
(或^{prepare_for_negotiated_authenticate(...)
)。 您应该传递额外的argrequested_authn_context
requested_authn_context
是类型为saml2.samlp.RequestedAuthnContext
的对象,其中包含所需的AuthnContextClassRef
相关问题 更多 >
编程相关推荐