public Set<AttributeStatementType> getAttributeStatements() { Set<AttributeStatementType> attributeStatements = new HashSet<AttributeStatementType>(); Set<StatementAbstractType> statements = getStatements(); if (statements != null) { for (StatementAbstractType statement : statements) { if (AttributeStatementType.class.isInstance(statement)) { attributeStatements.add((AttributeStatementType) statement); } } } return attributeStatements; }
public Set<AttributeStatementType> getAttributeStatements() { Set<AttributeStatementType> attributeStatements = new HashSet<AttributeStatementType>(); Set<StatementAbstractType> statements = getStatements(); if (statements != null) { for (StatementAbstractType statement : statements) { if (AttributeStatementType.class.isInstance(statement)) { attributeStatements.add((AttributeStatementType) statement); } } } return attributeStatements; }
/** * <p> Checks if the specified SAML assertion contains a {@code AttributeStatementType} and returns this type when it is * available. </p> * * @param assertion a reference to the {@code AssertionType} that may contain an {@code AttributeStatementType}. * * @return the assertion's {@code AttributeStatementType}, or {@code null} if no such type can be found in the SAML assertion. */ private AttributeStatementType getAttributeStatement(AssertionType assertion) { Set<StatementAbstractType> statementList = assertion.getStatements(); if (statementList.size() != 0) { for (StatementAbstractType statement : statementList) { if (statement instanceof AttributeStatementType) { return (AttributeStatementType) statement; } } } return null; } }
/** * <p> Checks if the specified SAML assertion contains a {@code AttributeStatementType} and returns this type when it is * available. </p> * * @param assertion a reference to the {@code AssertionType} that may contain an {@code AttributeStatementType}. * * @return the assertion's {@code AttributeStatementType}, or {@code null} if no such type can be found in the SAML assertion. */ private AttributeStatementType getAttributeStatement(AssertionType assertion) { Set<StatementAbstractType> statementList = assertion.getStatements(); if (statementList.size() != 0) { for (StatementAbstractType statement : statementList) { if (statement instanceof AttributeStatementType) { return (AttributeStatementType) statement; } } } return null; } }
private void populateSessionIndex(HttpServletRequest httpRequest, LogoutRequestType lot) throws ProcessingException, ConfigurationException, ParsingException { Document currentAssertion = (Document) httpRequest.getSession().getAttribute(GeneralConstants.ASSERTION_SESSION_ATTRIBUTE_NAME); if (currentAssertion != null) { AssertionType assertionType = SAMLUtil.fromElement(currentAssertion.getDocumentElement()); Set<StatementAbstractType> statements = assertionType.getStatements(); for (StatementAbstractType statementAbstractType : statements) { if (AuthnStatementType.class.isInstance(statementAbstractType)) { AuthnStatementType authnStatement = (AuthnStatementType) statementAbstractType; String sessionIndex = authnStatement.getSessionIndex(); if (sessionIndex != null) { lot.addSessionIndex(sessionIndex); } break; } } } }
private void populateSessionIndex(HttpServletRequest httpRequest, LogoutRequestType lot) throws ProcessingException, ConfigurationException, ParsingException { Document currentAssertion = (Document) httpRequest.getSession().getAttribute(GeneralConstants.ASSERTION_SESSION_ATTRIBUTE_NAME); if (currentAssertion != null) { AssertionType assertionType = SAMLUtil.fromElement(currentAssertion.getDocumentElement()); Set<StatementAbstractType> statements = assertionType.getStatements(); for (StatementAbstractType statementAbstractType : statements) { if (AuthnStatementType.class.isInstance(statementAbstractType)) { AuthnStatementType authnStatement = (AuthnStatementType) statementAbstractType; String sessionIndex = authnStatement.getSessionIndex(); if (sessionIndex != null) { lot.addSessionIndex(sessionIndex); } break; } } } }
private void populateSessionIndex(HttpServletRequest httpRequest, LogoutRequestType lot) throws ProcessingException, ConfigurationException, ParsingException { Document currentAssertion = (Document) httpRequest.getSession().getAttribute(GeneralConstants.ASSERTION_SESSION_ATTRIBUTE_NAME); if (currentAssertion != null) { AssertionType assertionType = SAMLUtil.fromElement(currentAssertion.getDocumentElement()); Set<StatementAbstractType> statements = assertionType.getStatements(); for (StatementAbstractType statementAbstractType : statements) { if (AuthnStatementType.class.isInstance(statementAbstractType)) { AuthnStatementType authnStatement = (AuthnStatementType) statementAbstractType; String sessionIndex = authnStatement.getSessionIndex(); if (sessionIndex != null) { lot.addSessionIndex(sessionIndex); } break; } } } }
Set<StatementAbstractType> statements = assertion.getStatements(); for (StatementAbstractType statement : statements) { if (statement instanceof AttributeStatementType) {
throw logger.samlHandlerAssertionNotFound(); Set<StatementAbstractType> statements = assertion.getStatements(); for (StatementAbstractType statement : statements) { if (statement instanceof AttributeStatementType) {
Set<StatementAbstractType> statements = assertion.getStatements(); for (StatementAbstractType statement : statements) { if (statement instanceof AttributeStatementType) {
throw logger.samlHandlerAssertionNotFound(); Set<StatementAbstractType> statements = assertion.getStatements(); for (StatementAbstractType statement : statements) { if (statement instanceof AttributeStatementType) {
public static XACMLAuthzDecisionStatementType getDecisionStatement(Node samlResponse) throws ConfigurationException, ProcessingException, ParsingException { XMLEventReader xmlEventReader = StaxParserUtil.getXMLEventReader(DocumentUtil.getNodeAsStream(samlResponse)); SAMLParser samlParser = new SAMLParser(); JAXPValidationUtil.checkSchemaValidation(samlResponse); org.picketlink.identity.federation.saml.v2.protocol.ResponseType response = (org.picketlink.identity.federation.saml.v2.protocol.ResponseType) samlParser .parse(xmlEventReader); List<RTChoiceType> choices = response.getAssertions(); for (RTChoiceType rst : choices) { AssertionType assertion = rst.getAssertion(); if (assertion == null) continue; Set<StatementAbstractType> stats = assertion.getStatements(); for (StatementAbstractType stat : stats) { if (stat instanceof XACMLAuthzDecisionStatementType) { return (XACMLAuthzDecisionStatementType) stat; } } } throw new RuntimeException("Not found XACMLAuthzDecisionStatementType"); }
public static XACMLAuthzDecisionStatementType getDecisionStatement(Node samlResponse) throws ConfigurationException, ProcessingException, ParsingException { XMLEventReader xmlEventReader = StaxParserUtil.getXMLEventReader(DocumentUtil.getNodeAsStream(samlResponse)); SAMLParser samlParser = new SAMLParser(); JAXPValidationUtil.checkSchemaValidation(samlResponse); org.picketlink.identity.federation.saml.v2.protocol.ResponseType response = (org.picketlink.identity.federation.saml.v2.protocol.ResponseType) samlParser .parse(xmlEventReader); List<RTChoiceType> choices = response.getAssertions(); for (RTChoiceType rst : choices) { AssertionType assertion = rst.getAssertion(); if (assertion == null) continue; Set<StatementAbstractType> stats = assertion.getStatements(); for (StatementAbstractType stat : stats) { if (stat instanceof XACMLAuthzDecisionStatementType) { return (XACMLAuthzDecisionStatementType) stat; } } } throw new RuntimeException("Not found XACMLAuthzDecisionStatementType"); }
public static XACMLAuthzDecisionStatementType getDecisionStatement(Node samlResponse) throws ConfigurationException, ProcessingException, ParsingException { XMLEventReader xmlEventReader = StaxParserUtil.getXMLEventReader(DocumentUtil.getNodeAsStream(samlResponse)); SAMLParser samlParser = new SAMLParser(); JAXPValidationUtil.checkSchemaValidation(samlResponse); org.picketlink.identity.federation.saml.v2.protocol.ResponseType response = (org.picketlink.identity.federation.saml.v2.protocol.ResponseType) samlParser .parse(xmlEventReader); List<RTChoiceType> choices = response.getAssertions(); for (RTChoiceType rst : choices) { AssertionType assertion = rst.getAssertion(); if (assertion == null) continue; Set<StatementAbstractType> stats = assertion.getStatements(); for (StatementAbstractType stat : stats) { if (stat instanceof XACMLAuthzDecisionStatementType) { return (XACMLAuthzDecisionStatementType) stat; } } } throw new RuntimeException("Not found XACMLAuthzDecisionStatementType"); }
public static XACMLAuthzDecisionStatementType getDecisionStatement(Node samlResponse) throws ConfigurationException, ProcessingException, ParsingException { XMLEventReader xmlEventReader = StaxParserUtil.getXMLEventReader(DocumentUtil.getNodeAsStream(samlResponse)); SAMLParser samlParser = new SAMLParser(); JAXPValidationUtil.checkSchemaValidation(samlResponse); org.picketlink.identity.federation.saml.v2.protocol.ResponseType response = (org.picketlink.identity.federation.saml.v2.protocol.ResponseType) samlParser .parse(xmlEventReader); List<RTChoiceType> choices = response.getAssertions(); for (RTChoiceType rst : choices) { AssertionType assertion = rst.getAssertion(); if (assertion == null) continue; Set<StatementAbstractType> stats = assertion.getStatements(); for (StatementAbstractType stat : stats) { if (stat instanceof XACMLAuthzDecisionStatementType) { return (XACMLAuthzDecisionStatementType) stat; } } } throw new RuntimeException("Not found XACMLAuthzDecisionStatementType"); }
public static XACMLAuthzDecisionStatementType getDecisionStatement(Node samlResponse) throws ConfigurationException, ProcessingException, ParsingException { XMLEventReader xmlEventReader = StaxParserUtil.getXMLEventReader(DocumentUtil.getNodeAsStream(samlResponse)); SAMLParser samlParser = new SAMLParser(); JAXPValidationUtil.checkSchemaValidation(samlResponse); org.picketlink.identity.federation.saml.v2.protocol.ResponseType response = (org.picketlink.identity.federation.saml.v2.protocol.ResponseType) samlParser .parse(xmlEventReader); List<RTChoiceType> choices = response.getAssertions(); for (RTChoiceType rst : choices) { AssertionType assertion = rst.getAssertion(); if (assertion == null) continue; Set<StatementAbstractType> stats = assertion.getStatements(); for (StatementAbstractType stat : stats) { if (stat instanceof XACMLAuthzDecisionStatementType) { return (XACMLAuthzDecisionStatementType) stat; } } } throw new RuntimeException("Not found XACMLAuthzDecisionStatementType"); }
/** * Consumes the assertion, resulting in the extraction of the Subject as the JAAS principal and the Role Statements as the JAAS * roles. * * @param assertion * * @throws Exception */ private void consumeAssertion(AssertionType assertion) throws Exception { SubjectType samlSubjectType = assertion.getSubject(); String samlSubject = ((NameIDType) samlSubjectType.getSubType().getBaseID()).getValue(); identity = createIdentity(samlSubject); Set<StatementAbstractType> statements = assertion.getStatements(); for (StatementAbstractType statement : statements) { if (statement instanceof AttributeStatementType) { AttributeStatementType attrStatement = (AttributeStatementType) statement; List<ASTChoiceType> attributes = attrStatement.getAttributes(); for (ASTChoiceType astChoiceType : attributes) { if (astChoiceType.getAttribute() != null && astChoiceType.getAttribute().getName().equals("Role")) { List<Object> values = astChoiceType.getAttribute().getAttributeValue(); for (Object roleValue : values) { if (roleValue != null) { roles.add(roleValue.toString()); } } } } } } }
/** * Consumes the assertion, resulting in the extraction of the Subject as the * JAAS principal and the Role Statements as the JAAS roles. * @param assertion * @throws Exception */ private void consumeAssertion(AssertionType assertion) throws Exception { SubjectType samlSubjectType = assertion.getSubject(); String samlSubject = ((NameIDType) samlSubjectType.getSubType().getBaseID()).getValue(); identity = createIdentity(samlSubject); Set<StatementAbstractType> statements = assertion.getStatements(); for (StatementAbstractType statement : statements) { if (statement instanceof AttributeStatementType) { AttributeStatementType attrStatement = (AttributeStatementType) statement; List<ASTChoiceType> attributes = attrStatement.getAttributes(); for (ASTChoiceType astChoiceType : attributes) { if (astChoiceType.getAttribute() != null && astChoiceType.getAttribute().getName().equals("Role")) { //$NON-NLS-1$ List<Object> values = astChoiceType.getAttribute().getAttributeValue(); for (Object roleValue : values) { if (roleValue != null) { roles.add(roleValue.toString()); } } } } } } }
/** * Consumes the assertion, resulting in the extraction of the Subject as the JAAS principal and the Role Statements as the JAAS * roles. * * @param assertion * * @throws Exception */ private void consumeAssertion(AssertionType assertion) throws Exception { SubjectType samlSubjectType = assertion.getSubject(); String samlSubject = ((NameIDType) samlSubjectType.getSubType().getBaseID()).getValue(); identity = createIdentity(samlSubject); Set<StatementAbstractType> statements = assertion.getStatements(); for (StatementAbstractType statement : statements) { if (statement instanceof AttributeStatementType) { AttributeStatementType attrStatement = (AttributeStatementType) statement; List<ASTChoiceType> attributes = attrStatement.getAttributes(); for (ASTChoiceType astChoiceType : attributes) { if (astChoiceType.getAttribute() != null && astChoiceType.getAttribute().getName().equals("Role")) { List<Object> values = astChoiceType.getAttribute().getAttributeValue(); for (Object roleValue : values) { if (roleValue != null) { roles.add(roleValue.toString()); } } } } } } }
Set<StatementAbstractType> statements = assertion.getStatements(); for (StatementAbstractType statement : statements) { if (statement instanceof AttributeStatementType) {