/** {@inheritDoc} */ protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject) throws UnmarshallingException { AuthorizationDecisionStatement authorizationDecisionStatement; authorizationDecisionStatement = (AuthorizationDecisionStatement) parentSAMLObject; if (childSAMLObject instanceof Action) { authorizationDecisionStatement.getActions().add((Action) childSAMLObject); } else if (childSAMLObject instanceof Evidence) { authorizationDecisionStatement.setEvidence((Evidence) childSAMLObject); } else { super.processChildElement(parentSAMLObject, childSAMLObject); } }
/** {@inheritDoc} */ protected void processAttribute(XMLObject samlObject, Attr attribute) throws UnmarshallingException { AuthorizationDecisionStatement authorizationDecisionStatement; authorizationDecisionStatement = (AuthorizationDecisionStatement) samlObject; if (AuthorizationDecisionStatement.DECISION_ATTRIB_NAME.equals(attribute.getLocalName())) { String value = attribute.getValue(); if (value.equals(DecisionTypeEnumeration.PERMIT.toString())) { authorizationDecisionStatement.setDecision(DecisionTypeEnumeration.PERMIT); } else if (value.equals(DecisionTypeEnumeration.DENY.toString())) { authorizationDecisionStatement.setDecision(DecisionTypeEnumeration.DENY); } else if (value.equals(DecisionTypeEnumeration.INDETERMINATE.toString())) { authorizationDecisionStatement.setDecision(DecisionTypeEnumeration.INDETERMINATE); } else { log.error("Unknown value for DecisionType '" + value + "'"); throw new UnmarshallingException("Unknown value for DecisionType '" + value + "'"); } } else if (AuthorizationDecisionStatement.RESOURCE_ATTRIB_NAME.equals(attribute.getLocalName())) { authorizationDecisionStatement.setResource(attribute.getValue()); } else { super.processAttribute(samlObject, attribute); } } }
/** {@inheritDoc} */ protected void marshallAttributes(XMLObject samlElement, Element domElement) throws MarshallingException { AuthorizationDecisionStatement authorizationDecisionStatement; authorizationDecisionStatement = (AuthorizationDecisionStatement) samlElement; if (authorizationDecisionStatement.getResource() != null) { domElement.setAttributeNS(null, AuthorizationDecisionStatement.RESOURCE_ATTRIB_NAME, authorizationDecisionStatement.getResource()); } if (authorizationDecisionStatement.getDecision() != null) { domElement.setAttributeNS(null, AuthorizationDecisionStatement.DECISION_ATTRIB_NAME, authorizationDecisionStatement.getDecision().toString()); } } }
Subject authDecisionSubject = SAML1ComponentBuilder.createSaml1v1Subject(decisionStatementBean.getSubject()); authDecision.setSubject(authDecisionSubject); authDecision.setResource(decisionStatementBean.getResource()); authDecision.setDecision(transformDecisionType(decisionStatementBean.getDecision())); authDecision.getActions().add(actionElement); authDecision.setEvidence((Evidence)decisionStatementBean.getEvidence());
private static org.opensaml.saml.saml1.core.Subject getSaml1Subject(SamlAssertionWrapper assertionW) { for (Statement stmt : assertionW.getSaml1().getStatements()) { org.opensaml.saml.saml1.core.Subject samlSubject = null; if (stmt instanceof AttributeStatement) { AttributeStatement attrStmt = (AttributeStatement) stmt; samlSubject = attrStmt.getSubject(); } else if (stmt instanceof AuthenticationStatement) { AuthenticationStatement authStmt = (AuthenticationStatement) stmt; samlSubject = authStmt.getSubject(); } else { AuthorizationDecisionStatement authzStmt = (AuthorizationDecisionStatement)stmt; samlSubject = authzStmt.getSubject(); } if (samlSubject != null) { return samlSubject; } } return null; }
private static org.opensaml.saml.saml1.core.Subject getSaml1Subject(SamlAssertionWrapper assertionW) { for (Statement stmt : assertionW.getSaml1().getStatements()) { org.opensaml.saml.saml1.core.Subject samlSubject = null; if (stmt instanceof AttributeStatement) { AttributeStatement attrStmt = (AttributeStatement) stmt; samlSubject = attrStmt.getSubject(); } else if (stmt instanceof AuthenticationStatement) { AuthenticationStatement authStmt = (AuthenticationStatement) stmt; samlSubject = authStmt.getSubject(); } else { AuthorizationDecisionStatement authzStmt = (AuthorizationDecisionStatement)stmt; samlSubject = authzStmt.getSubject(); } if (samlSubject != null) { return samlSubject; } } return null; }
if (statement.getSubject() != null && statement.getSubject().getNameIdentifier() != null) { return statement.getSubject().getNameIdentifier().getFormat();
if (statement.getSubject() != null && statement.getSubject().getNameIdentifier() != null) { return statement.getSubject().getNameIdentifier().getValue();
AuthorizationDecisionStatement authzStmt = (AuthorizationDecisionStatement)stmt; samlSubject = authzStmt.getSubject();
org.opensaml.saml.saml1.core.AuthorizationDecisionStatement authzStmt = (org.opensaml.saml.saml1.core.AuthorizationDecisionStatement)stmt; samlSubject = authzStmt.getSubject();