-1
我在opensaml-J初学者,我想创建一个断言委派功能我已经写在SAML断言,这里的形象:SAML-based representation of capability如何在java中创建和处理saml断言?
所以有人可以帮助我创造了图片中显示的断言与opensaml-j 以及如何处理后者?
我在opensaml-J初学者,我想创建一个断言委派功能我已经写在SAML断言,这里的形象:SAML-based representation of capability如何在java中创建和处理saml断言?
所以有人可以帮助我创造了图片中显示的断言与opensaml-j 以及如何处理后者?
所以创建断言一种方法是:
AuthnRequest authnRequest = new AuthnRequestBuilder().buildObject();
设置你的SAML 2.0请求的强制属性。您需要决定SAML请求中的内容。
authnRequest.setID(<>));
authnRequest.setVersion(SAMLVersion.VERSION_20);
authnRequest.setIssueInstant(new DateTime());
authnRequest.setProtocolBinding(httpBinding);
authnRequest.setIssuer(issuer);
authnRequest.setNameIDPolicy(nameIdPolicy);
authnRequest.setRequestedAuthnContext(requestedAuthnContext);
authnRequest.setDestination(idpUrl);
在您发送之前,您可能需要签名,这是通过在请求中添加签名来完成的。
一旦你收到一个响应SMAL你可以通过验证其签名验证它:
// Signature validation
Signature signature = samlResponse.getSignature();
SignatureValidator signatureValidator = new SignatureValidator(
new X509CredentialImplementation(<>);
try {
signatureValidator.validate(signature);
} catch (ValidationException e) {
LOGGER.error("XML signature is not **validate**, or there is an error during the validation operation");
return false;
}
目前尚不清楚如何以及在哪里,你要发送的断言。但这是基本的程序。
感谢您的帮助我真的appriciate它我只想问你关于其他标签(Condtion,Action,AuthzDecisionStatement)我将如何创建它们?你能给我一个更详细的例子吗? –