如何在SAML请求中将username password作为属性传递,如以下代码所示。我使用lastpass-saml-sdk.jar与GLUU服务器通信。
SAMLInit.initialize();
String dir = Constants.METADATA_LOCATION;
if (dir == null)
throw new SAMLException("Unable to locate SAML metadata");
IdPConfig idpConfig = new IdPConfig(new File(dir + "\\gluu-idp-metadata.xml"));
SPConfig spConfig = new SPConfig(new File(dir + "\\sp-meta.xml"));
SAMLClient client= new SAMLClient(spConfig, idpConfig);
// when a login link is clicked, create auth request and
// redirect to the IdP
String requestId = SAMLUtils.generateRequestId();
String authrequest = client.generateAuthnRequest(requestId);
String url = client.getIdPConfig().getLoginUrl() +
"?SAMLRequest=" + URLEncoder.encode(authrequest, "UTF-8");
// redirect to url...
response.sendRedirect(url);发布于 2015-06-15 20:22:22
您不会将用户名和密码直接传递给身份提供程序。在您重定向用户后,用户将自己在IDP处输入用户名和密码。
描述SAML Web rowser配置文件中的流的Here is one of my blog posts。
https://stackoverflow.com/questions/30843691
复制相似问题