简体   繁体   English

SAML 2.0密码验证

[英]SAML 2.0 password authentication

I'm aware of how SAML is used for single sign on (SSO). 我知道SAML如何用于单点登录(SSO)。 That is, redirection to IDP from SP and getting the user's identity from the SAML response/assertion. 也就是说,从SP重定向到IDP,并从SAML响应/声明中获取用户的身份。

My question is - Does SAML 2.0 specification define how to pass username and password as part of a SAML request xml for authentication? 我的问题是-SAML 2.0规范是否定义了如何将用户名和密码作为SAML请求xml的一部分进行身份验证? Note that I'm not talking about single sign on and just want authentication of username/password. 请注意,我不是在谈论单点登录,而只是想对用户名/密码进行身份验证。

Thanks, 谢谢,

The SAML standard supports passing a user identifier in the <saml:Subject> field of the <AuthnRequest> (ie the request for authentication). SAML标准支持在<AuthnRequest><saml:Subject>字段(即,身份验证请求)中传递用户标识符。

There is however no built in support for passing a password as part of the AuthnRequest . 但是,没有内置支持将密码作为AuthnRequest一部分传递。 IMHO doing so goes against the principles of SAML2 as that expects the Idp to only use a password when authenticating. 恕我直言,这样做违反了SAML2的原则,因为它希望Idp仅在身份验证时使用密码。 Normally the Idp may use any means it finds suitable to confirm the identity of the subject. 通常,Idp可以使用其认为合适的任何方式来确认受试者的身份。 That could be a password, but also a certificate or a one time pad exchange over SMS. 那可以是密码,也可以是证书,也可以是一次短信交换。 Or something else - it's up to the Idp. 还是其他问题-由Idp决定。

That said, there is an <Extensions> element in the <AuthnRequest> that could be used to carry a password. 就是说,在<AuthnRequest>中有一个<Extensions>元素,可用于携带密码。 Doing so would require careful security considerations as the AuthnRequest contents are not designed to be kept secret. 这样做需要仔细考虑安全性,因为AuthnRequest内容并非旨在保密。 If using the Http Redirect binding the contents are logged in a web server and visible in browser history. 如果使用Http重定向绑定,则内容将记录在Web服务器中,并在浏览器历史记录中可见。 If using the Http POST binding the password is still visible to the browser. 如果使用Http POST绑定,则浏览器仍然可以看到密码。 I would suggest using the SOAP or Artifact binding to make sure the data is transferred directly from the SP to the Idp. 我建议使用SOAP或Artifact绑定来确保将数据直接从SP传输到Idp。 Note however that those bindings have considerable less support in frameworks. 但是请注意,这些绑定在框架中的支持要少得多。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM