Package org.picketlink.identity.federation.saml.v2.assertion

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


      responseType = saml2Response.createResponseType(id, sp, idp, issuerHolder);
      //Add information on the roles
      List<String> roles = rg.generateRoles(userPrincipal);
      AssertionType assertion = (AssertionType) responseType.getAssertionOrEncryptedAssertion().get(0);

      AttributeStatementType attrStatement = saml2Response.createAttributeStatement(roles);
      assertion.getStatementOrAuthnStatementOrAuthzDecisionStatement().add(attrStatement);
     
      //Add timed conditions
      try
      {
View Full Code Here


      NameIDType nameID = jnameID.getValue();
      String userName = nameID.getValue();
      List<String> roles = new ArrayList<String>();

      //Let us get the roles
      AttributeStatementType attributeStatement = (AttributeStatementType) assertion.getStatementOrAuthnStatementOrAuthzDecisionStatement().get(0);
      List<Object> attList = attributeStatement.getAttributeOrEncryptedAttribute();
      for(Object obj:attList)
      {
         AttributeType attr = (AttributeType) obj;
         String roleName = (String) attr.getAttributeValue().get(0);
         roles.add(roleName);
View Full Code Here

     
     
      //Add information on the roles
      AssertionType assertion = (AssertionType) responseType.getAssertionOrEncryptedAssertion().get(0);

      AttributeStatementType attrStatement = saml2Response.createAttributeStatement(roles);
      assertion.getStatementOrAuthnStatementOrAuthzDecisionStatement().add(attrStatement);
     
      //Add timed conditions
      saml2Response.createTimedConditions(assertion, assertionValidity);
View Full Code Here

      NameIDType nameID = jnameID.getValue();
      final String userName = nameID.getValue();
      List<String> roles = new ArrayList<String>();

      //Let us get the roles
      AttributeStatementType attributeStatement = (AttributeStatementType) assertion.getStatementOrAuthnStatementOrAuthzDecisionStatement().get(0);
      List<Object> attList = attributeStatement.getAttributeOrEncryptedAttribute();
      for(Object obj:attList)
      {
         AttributeType attr = (AttributeType) obj;
         String roleName = (String) attr.getAttributeValue().get(0);
         roles.add(roleName);
View Full Code Here

     
     
      //Add information on the roles
      AssertionType assertion = (AssertionType) responseType.getAssertionOrEncryptedAssertion().get(0);

      AttributeStatementType attrStatement = saml2Response.createAttributeStatement(roles);
      assertion.getStatementOrAuthnStatementOrAuthzDecisionStatement().add(attrStatement);
     
      //Add timed conditions
      saml2Response.createTimedConditions(assertion, assertionValidity);
View Full Code Here

    * @param attributeValue
    * @return
    */
   public static AttributeStatementType createAttributeStatement(String attributeValue)
   {
      AttributeStatementType attribStatement = assertionObjectFactory.createAttributeStatementType();
      AttributeType att = assertionObjectFactory.createAttributeType();
      JAXBElement<Object> attValue = assertionObjectFactory.createAttributeValue(attributeValue);
      att.getAttributeValue().add(attValue);
      attribStatement.getAttributeOrEncryptedAttribute().add(att);
      return attribStatement;
   }
View Full Code Here

    * @param attributes a map with keys from {@link AttributeConstants}
    * @return
    */
   public static AttributeStatementType createAttributeStatement(Map<String,Object> attributes)
   {
      AttributeStatementType attrStatement = null;
     
      int i = 0;
     
      Set<String> keys = attributes.keySet();
      for(String key: keys)
      {
         if(i == 0)
         {
            //Deal with the X500 Profile of SAML2
            attrStatement = JBossSAMLBaseFactory.createAttributeStatement();
            i++;
         }
         AttributeType att = getX500Attribute();
         
         Object value = attributes.get(key);
        
         if(AttributeConstants.EMAIL_ADDRESS.equals(key))
         {  
            att.setFriendlyName(X500SAMLProfileConstants.EMAIL_ADDRESS.getFriendlyName());
            att.setName(X500SAMLProfileConstants.EMAIL_ADDRESS.get());
         }
         else if(AttributeConstants.EMPLOYEE_NUMBER.equals(key))
         {  
            att.setFriendlyName(X500SAMLProfileConstants.EMPLOYEE_NUMBER.getFriendlyName());
            att.setName(X500SAMLProfileConstants.EMPLOYEE_NUMBER.get());
         }
         else if(AttributeConstants.GIVEN_NAME.equals(key))
         {  
            att.setFriendlyName(X500SAMLProfileConstants.GIVENNAME.getFriendlyName());
            att.setName(X500SAMLProfileConstants.GIVENNAME.get());
         }
         else if(AttributeConstants.TELEPHONE.equals(key))
         {  
            att.setFriendlyName(X500SAMLProfileConstants.TELEPHONE.getFriendlyName());
            att.setName(X500SAMLProfileConstants.TELEPHONE.get());
         }
         att.getAttributeValue().add(value);
         attrStatement.getAttributeOrEncryptedAttribute().add(att);
      }
      return attrStatement;
   }
View Full Code Here

      {
         for (StatementAbstractType statement : assertion.getStatementOrAuthnStatementOrAuthzDecisionStatement())
         {
            if (statement instanceof AttributeStatementType)
            {
               AttributeStatementType attributeStatement = (AttributeStatementType) statement;
               for (Object object : attributeStatement.getAttributeOrEncryptedAttribute())
               {
                  if (object instanceof AttributeType)
                  {
                     AttributeType attr = (AttributeType) object;
                     List<String> values = user.attributes.get(attr.getName());
View Full Code Here

    * @param roles
    * @return
    */
   public AttributeStatementType createAttributeStatement(List<String> roles)
   {
      AttributeStatementType attrStatement = JBossSAMLBaseFactory.createAttributeStatement();
      for(String role: roles)
      {
         AttributeType attr = JBossSAMLBaseFactory.createAttributeForRole(role);
         attrStatement.getAttributeOrEncryptedAttribute().add(attr);
      }
      return attrStatement;
   }
View Full Code Here

      responseType = saml2Response.createResponseType(id, sp, idp, issuerHolder);
     
      //Add information on the roles
      AssertionType assertion = (AssertionType) responseType.getAssertionOrEncryptedAssertion().get(0);

      AttributeStatementType attrStatement = saml2Response.createAttributeStatement(roles);
      assertion.getStatementOrAuthnStatementOrAuthzDecisionStatement().add(attrStatement);
     
      //Add timed conditions
      saml2Response.createTimedConditions(assertion, assertionValidity);
     
      //Add in the attributes information
      if(this.attributeManager != null)
      {
         try
         {
            Map<String, Object> attribs =
               attributeManager.getAttributes(userPrincipal, this.attribKeys);
            AttributeStatementType attStatement = StatementUtil.createAttributeStatement(attribs);
            assertion.getStatementOrAuthnStatementOrAuthzDecisionStatement().add(attStatement);
         }
         catch(Exception e)
         {
            log.error("Exception in generating attributes:",e);
View Full Code Here

TOP

Related Classes of org.picketlink.identity.federation.saml.v2.assertion.AttributeStatementType

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.