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

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


      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

      //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);
      }
      return this.createGenericPrincipal(request, userName, roles);      
   }
View Full Code Here

      //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);
      }
     
      Principal principal = new Principal()
      {
View Full Code Here

    */
   public static AttributeType createAttribute(String name, String nameFormat,
         Object... attributeValues)
   {
      ObjectFactory of = SAMLAssertionFactory.getObjectFactory();
      AttributeType att = of.createAttributeType();
      att.setName(name);
      att.setNameFormat(nameFormat);
      if(attributeValues != null && attributeValues.length > 0)
      {
         for(Object attributeValue:attributeValues)
         {
            att.getAttributeValue().add(of.createAttributeValue(attributeValue));
         }
      }
      return att;
   }
View Full Code Here

    * @param roleName
    * @return
    */
   public static AttributeType createAttributeForRole(String roleName)
   {
      AttributeType att = assertionObjectFactory.createAttributeType();
      att.setFriendlyName("role");
      att.setName("role");
      att.setNameFormat(JBossSAMLURIConstants.ATTRIBUTE_FORMAT_BASIC.get());
     
      //rolename
      att.getAttributeValue().add(roleName);
     
      return att;
   }
View Full Code Here

    * @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

         {
            //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

TOP

Related Classes of org.jboss.identity.federation.saml.v2.assertion.AttributeType

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.