Package org.jboss.seam.security.external

Examples of org.jboss.seam.security.external.SamlPrincipalImpl


        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) {
                AttributeStatementType attributeStatement = (AttributeStatementType) statement;
                List<AttributeType> attributes = new LinkedList<AttributeType>();
                for (Object object : attributeStatement.getAttributeOrEncryptedAttribute()) {
                    if (object instanceof AttributeType) {
                        attributes.add((AttributeType) object);
                    } else {
                        log.warn("Encrypted attributes are not supported. Ignoring the attribute.");
                    }
                }
                principal.setAttributes(attributes);
            }
        }

        return session;
    }
View Full Code Here


    public SamlNameId createNameId(String value, String format, String qualifier) {
        return new SamlNameIdImpl(value, format, qualifier);
    }

    private SamlIdpSession createSession(SamlNameId nameId, List<AttributeType> attributes) {
        SamlPrincipalImpl samlPrincipal = new SamlPrincipalImpl();
        samlPrincipal.setNameId(nameId);
        if (attributes != null) {
            samlPrincipal.setAttributes(attributes);
        } else {
            samlPrincipal.setAttributes(new LinkedList<AttributeType>());
        }
        return samlIdpSessions.addSession(samlPrincipal);
    }
View Full Code Here

      return new SamlNameIdImpl(value, format, qualifier);
   }

   private SamlIdpSession createSession(SamlNameId nameId, List<AttributeType> attributes)
   {
      SamlPrincipalImpl samlPrincipal = new SamlPrincipalImpl();
      samlPrincipal.setNameId(nameId);
      if (attributes != null)
      {
         samlPrincipal.setAttributes(attributes);
      }
      else
      {
         samlPrincipal.setAttributes(new LinkedList<AttributeType>());
      }
      return samlIdpSessions.addSession(samlPrincipal);
   }
View Full Code Here

      {
         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)
         {
            AttributeStatementType attributeStatement = (AttributeStatementType) statement;
            List<AttributeType> attributes = new LinkedList<AttributeType>();
            for (Object object : attributeStatement.getAttributeOrEncryptedAttribute())
            {
               if (object instanceof AttributeType)
               {
                  attributes.add((AttributeType) object);
               }
               else
               {
                  log.warn("Encrypted attributes are not supported. Ignoring the attribute.");
               }
            }
            principal.setAttributes(attributes);
         }
      }

      return session;
   }
View Full Code Here

TOP

Related Classes of org.jboss.seam.security.external.SamlPrincipalImpl

Copyright © 2018 www.massapicom. 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.