Examples of AuthnStatementType


Examples of org.jboss.identity.federation.saml.v2.assertion.AuthnStatementType

    */
   public AuthnStatementType createAuthnStatement(String authnContextDeclRef,
         XMLGregorianCalendar issueInstant)
   {
      ObjectFactory objectFactory = SAMLAssertionFactory.getObjectFactory();
      AuthnStatementType authnStatement = objectFactory.createAuthnStatementType();
      authnStatement.setAuthnInstant(issueInstant);
      AuthnContextType act = objectFactory.createAuthnContextType();
      String authContextDeclRef = JBossSAMLURIConstants.AC_PASSWORD_PROTECTED_TRANSPORT.get();
      act.getContent().add(objectFactory.createAuthnContextDeclRef(authContextDeclRef));
      authnStatement.setAuthnContext(act);
      return authnStatement;
   }
View Full Code Here

Examples of org.jboss.identity.federation.saml.v2.assertion.AuthnStatementType

    */
   public AuthnStatementType createAuthnStatement(String authnContextDeclRef,
         XMLGregorianCalendar issueInstant)
   {
      ObjectFactory objectFactory = SAMLAssertionFactory.getObjectFactory();
      AuthnStatementType authnStatement = objectFactory.createAuthnStatementType();
      authnStatement.setAuthnInstant(issueInstant);
      AuthnContextType act = objectFactory.createAuthnContextType();
      String authContextDeclRef = JBossSAMLURIConstants.AC_PASSWORD_PROTECTED_TRANSPORT.get();
      act.getContent().add(objectFactory.createAuthnContextDeclRef(authContextDeclRef));
      authnStatement.setAuthnContext(act);
      return authnStatement;
   }
View Full Code Here

Examples of org.jboss.seam.security.external.jaxb.samlv2.assertion.AuthnStatementType

        assertion.setConditions(conditions);
        AudienceRestrictionType audienceRestriction = assertionObjectFactory.createAudienceRestrictionType();
        conditions.getConditionOrAudienceRestrictionOrOneTimeUse().add(audienceRestriction);
        audienceRestriction.getAudience().add(samlDialogue.get().getExternalProvider().getEntityId());

        AuthnStatementType authnStatement = assertionObjectFactory.createAuthnStatementType();
        assertion.getStatementOrAuthnStatementOrAuthzDecisionStatement().add(authnStatement);
        authnStatement.setAuthnInstant(SamlUtils.getXMLGregorianCalendarNow());
        authnStatement.setSessionIndex(((SamlIdpSessionImpl) session).getSessionIndex());

        AuthnContextType authnContext = assertionObjectFactory.createAuthnContextType();
        authnStatement.setAuthnContext(authnContext);
        authnContext.getContent().add(assertionObjectFactory.createAuthnContextDeclRef(SamlConstants.AC_PASSWORD_PROTECTED_TRANSPORT));

        return response;
    }
View Full Code Here

Examples of org.jboss.seam.security.external.jaxb.samlv2.assertion.AuthnStatementType

        if (SamlUtils.hasAssertionExpired(assertion)) {
            log.warn("Received assertion not processed because it has expired.");
            return null;
        }

        AuthnStatementType authnStatement = extractValidAuthnStatement(assertion);
        if (authnStatement == null) {
            log.warn("Received assertion not processed because it doesn't contain a valid authnStatement.");
            return null;
        }

        NameIDType nameId = validateSubjectAndExtractNameID(assertion);
        if (nameId == null) {
            log.warn("Received assertion not processed because it doesn't contain a valid subject.");
            return null;
        }

        SamlPrincipalImpl principal = new SamlPrincipalImpl();
        principal.setAssertion(assertion);
        principal.setNameId(new SamlNameIdImpl(nameId.getValue(), nameId.getFormat(), nameId.getNameQualifier()));
        SamlSpSessionImpl session = new SamlSpSessionImpl();
        session.setSessionIndex(authnStatement.getSessionIndex());
        session.setPrincipal(principal);
        session.setIdentityProvider(idp);

        for (StatementAbstractType statement : assertion.getStatementOrAuthnStatementOrAuthzDecisionStatement()) {
            if (statement instanceof AttributeStatementType) {
View Full Code Here

Examples of org.jboss.seam.security.external.jaxb.samlv2.assertion.AuthnStatementType

    }

    private AuthnStatementType extractValidAuthnStatement(AssertionType assertion) {
        for (StatementAbstractType statement : assertion.getStatementOrAuthnStatementOrAuthzDecisionStatement()) {
            if (statement instanceof AuthnStatementType) {
                AuthnStatementType authnStatement = (AuthnStatementType) statement;
                return authnStatement;
            }
        }

        return null;
View Full Code Here

Examples of org.jboss.seam.security.external.jaxb.samlv2.assertion.AuthnStatementType

      {
         log.warn("Received assertion not processed because it has expired.");
         return null;
      }

      AuthnStatementType authnStatement = extractValidAuthnStatement(assertion);
      if (authnStatement == null)
      {
         log.warn("Received assertion not processed because it doesn't contain a valid authnStatement.");
         return null;
      }

      NameIDType nameId = validateSubjectAndExtractNameID(assertion);
      if (nameId == null)
      {
         log.warn("Received assertion not processed because it doesn't contain a valid subject.");
         return null;
      }

      SamlPrincipalImpl principal = new SamlPrincipalImpl();
      principal.setAssertion(assertion);
      principal.setNameId(new SamlNameIdImpl(nameId.getValue(), nameId.getFormat(), nameId.getNameQualifier()));
      SamlSpSessionImpl session = new SamlSpSessionImpl();
      session.setSessionIndex(authnStatement.getSessionIndex());
      session.setPrincipal(principal);
      session.setIdentityProvider(idp);

      for (StatementAbstractType statement : assertion.getStatementOrAuthnStatementOrAuthzDecisionStatement())
      {
View Full Code Here

Examples of org.jboss.seam.security.external.jaxb.samlv2.assertion.AuthnStatementType

   {
      for (StatementAbstractType statement : assertion.getStatementOrAuthnStatementOrAuthzDecisionStatement())
      {
         if (statement instanceof AuthnStatementType)
         {
            AuthnStatementType authnStatement = (AuthnStatementType) statement;
            return authnStatement;
         }
      }

      return null;
View Full Code Here

Examples of org.jboss.seam.security.external.jaxb.samlv2.assertion.AuthnStatementType

      assertion.setConditions(conditions);
      AudienceRestrictionType audienceRestriction = assertionObjectFactory.createAudienceRestrictionType();
      conditions.getConditionOrAudienceRestrictionOrOneTimeUse().add(audienceRestriction);
      audienceRestriction.getAudience().add(samlDialogue.get().getExternalProvider().getEntityId());

      AuthnStatementType authnStatement = assertionObjectFactory.createAuthnStatementType();
      assertion.getStatementOrAuthnStatementOrAuthzDecisionStatement().add(authnStatement);
      authnStatement.setAuthnInstant(SamlUtils.getXMLGregorianCalendarNow());
      authnStatement.setSessionIndex(((SamlIdpSessionImpl) session).getSessionIndex());

      AuthnContextType authnContext = assertionObjectFactory.createAuthnContextType();
      authnStatement.setAuthnContext(authnContext);
      authnContext.getContent().add(assertionObjectFactory.createAuthnContextDeclRef(SamlConstants.AC_PASSWORD_PROTECTED_TRANSPORT));

      return response;
   }
View Full Code Here

Examples of org.picketlink.identity.federation.saml.v2.assertion.AuthnStatementType

        if (!disableAuthnStatement) {
            String authContextRef = JBossSAMLURIConstants.AC_UNSPECIFIED.get();
            if (isNotNull(authMethod))
                authContextRef = authMethod;

            AuthnStatementType authnStatement = StatementUtil.createAuthnStatement(XMLTimeUtil.getIssueInstant(),
                    authContextRef);

            authnStatement.setSessionIndex(assertion.getID());

            assertion.addStatement(authnStatement);
        }

        if (roles != null && !roles.isEmpty()) {
View Full Code Here

Examples of org.picketlink.identity.federation.saml.v2.assertion.AuthnStatementType

                SAMLConditionsParser conditionsParser = new SAMLConditionsParser();
                ConditionsType conditions = (ConditionsType) conditionsParser.parse(xmlEventReader);

                assertion.setConditions(conditions);
            } else if (JBossSAMLConstants.AUTHN_STATEMENT.get().equalsIgnoreCase(tag)) {
                AuthnStatementType authnStatementType = SAMLParserUtil.parseAuthnStatement(xmlEventReader);
                assertion.addStatement(authnStatementType);
            } else if (JBossSAMLConstants.ATTRIBUTE_STATEMENT.get().equalsIgnoreCase(tag)) {
                AttributeStatementType attributeStatementType = SAMLParserUtil.parseAttributeStatement(xmlEventReader);
                assertion.addStatement(attributeStatementType);
            } else if (JBossSAMLConstants.STATEMENT.get().equalsIgnoreCase(tag)) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.