誰かが私にポリシーファイルからopenSAML2apiを使用してXACMLObjectを構築する方法のアイデアを私に与えることができる良いチュートリアルのリンクを教えてもらえますか?ありがとう
2 に答える
1
私はこの目的のためにOpenSAMLライブラリを使用していません。しかし、私はXACMLの要求と応答を含む他の目的に使用しました。以下はあなたがアイデアを得るのを助けるかもしれません。文字列からXACMLRequestを作成しています。
private String extractXACMLRequest(String decisionQuery) throws Exception {
RequestType xacmlRequest = null;
doBootstrap();
String queryString = null;
XACMLAuthzDecisionQueryType xacmlAuthzDecisionQuery;
try {
xacmlAuthzDecisionQuery = (XACMLAuthzDecisionQueryType) unmarshall(decisionQuery);
//Access the XACML request only if Issuer and the Signature are valid.
if (validateIssuer(xacmlAuthzDecisionQuery.getIssuer())) {
if (validateSignature(xacmlAuthzDecisionQuery.getSignature())) {
xacmlRequest = xacmlAuthzDecisionQuery.getRequest();
} else {
log.debug("The submitted signature is not valid!");
}
} else {
log.debug("The submitted issuer is not valid!");
}
if (xacmlRequest != null) {
queryString = marshall(xacmlRequest);
queryString = queryString.replace("<?xml version=\"1.0\" encoding=\"UTF-8\"?>", "").replace("\n", "");
}
return queryString;
} catch (Exception e) {
log.error("Error unmarshalling the XACMLAuthzDecisionQuery.", e);
throw new Exception("Error unmarshalling the XACMLAuthzDecisionQuery.", e);
}
}
于 2013-11-12T09:16:26.650 に答える
0
sunXACMLまたはJAXBを使用して、openSAML2ではなくXACMLポリシーをマーシャル/アンマーシャルします。
于 2013-09-19T19:10:44.160 に答える