Examples of AttributeType


Examples of org.opensaml.xacml.ctx.AttributeType

        // Subject
        AttributeValueType subjectIdAttributeValue =
            RequestComponentBuilder.createAttributeValueType(
                    "alice-user@apache.org"
            );
        AttributeType subjectIdAttribute =
            RequestComponentBuilder.createAttributeType(
                    XACMLConstants.SUBJECT_ID,
                    XACMLConstants.RFC_822_NAME,
                    null,
                    Collections.singletonList(subjectIdAttributeValue)
            );
       
        AttributeValueType subjectGroupAttributeValue =
            RequestComponentBuilder.createAttributeValueType(
                    "manager"
            );
        AttributeType subjectGroupAttribute =
            RequestComponentBuilder.createAttributeType(
                    XACMLConstants.SUBJECT_ROLE,
                    XACMLConstants.XS_ANY_URI,
                    "admin-user@apache.org",
                    Collections.singletonList(subjectGroupAttributeValue)
            );
        List<AttributeType> attributes = new ArrayList<AttributeType>();
        attributes.add(subjectIdAttribute);
        attributes.add(subjectGroupAttribute);
        SubjectType subject = RequestComponentBuilder.createSubjectType(attributes, null);
       
        // Resource
        AttributeValueType resourceAttributeValue =
            RequestComponentBuilder.createAttributeValueType(
                    "{http://www.example.org/contract/DoubleIt}DoubleIt"
            );
        AttributeType resourceAttribute =
            RequestComponentBuilder.createAttributeType(
                    XACMLConstants.RESOURCE_ID,
                    XACMLConstants.XS_STRING,
                    null,
                    Collections.singletonList(resourceAttributeValue)
            );
        attributes.clear();
        attributes.add(resourceAttribute);
        ResourceType resource = RequestComponentBuilder.createResourceType(attributes, null);
       
        // Action
        AttributeValueType actionAttributeValue =
            RequestComponentBuilder.createAttributeValueType(
                    "execute"
            );
        AttributeType actionAttribute =
            RequestComponentBuilder.createAttributeType(
                    XACMLConstants.ACTION_ID,
                    XACMLConstants.XS_STRING,
                    null,
                    Collections.singletonList(actionAttributeValue)
View Full Code Here

Examples of org.opensaml.xacml.ctx.AttributeType

        // Subject
        AttributeValueType subjectIdAttributeValue =
            RequestComponentBuilder.createAttributeValueType(
                    "alice-user@apache.org"
            );
        AttributeType subjectIdAttribute =
            RequestComponentBuilder.createAttributeType(
                    XACMLConstants.SUBJECT_ID,
                    XACMLConstants.RFC_822_NAME,
                    null,
                    Collections.singletonList(subjectIdAttributeValue)
            );
       
        List<AttributeType> attributes = new ArrayList<AttributeType>();
        attributes.add(subjectIdAttribute);
        SubjectType subject = RequestComponentBuilder.createSubjectType(attributes, null);
       
        // Resource
        AttributeValueType resourceAttributeValue =
            RequestComponentBuilder.createAttributeValueType(
                    "{http://www.example.org/contract/DoubleIt}DoubleIt"
            );
        AttributeType resourceAttribute =
            RequestComponentBuilder.createAttributeType(
                    XACMLConstants.RESOURCE_ID,
                    XACMLConstants.XS_STRING,
                    null,
                    Collections.singletonList(resourceAttributeValue)
            );
        attributes.clear();
        attributes.add(resourceAttribute);
        ResourceType resource = RequestComponentBuilder.createResourceType(attributes, null);
       
        // Action
        AttributeValueType actionAttributeValue =
            RequestComponentBuilder.createAttributeValueType(
                    "execute"
            );
        AttributeType actionAttribute =
            RequestComponentBuilder.createAttributeType(
                    XACMLConstants.ACTION_ID,
                    XACMLConstants.XS_STRING,
                    null,
                    Collections.singletonList(actionAttributeValue)
            );
        attributes.clear();
        attributes.add(actionAttribute);
        ActionType action = RequestComponentBuilder.createActionType(attributes);
       
        // Environment
        DateTime dateTime = new DateTime();
        AttributeValueType environmentAttributeValue =
            RequestComponentBuilder.createAttributeValueType(dateTime.toString());
        AttributeType environmentAttribute =
            RequestComponentBuilder.createAttributeType(
                    XACMLConstants.CURRENT_DATETIME,
                    XACMLConstants.XS_DATETIME,
                    null,
                    Collections.singletonList(environmentAttributeValue)
View Full Code Here

Examples of org.opensaml.xacml.ctx.AttributeType

       
        // Subject
        List<AttributeType> attributes = new ArrayList<AttributeType>();
        AttributeValueType subjectIdAttributeValue =
            RequestComponentBuilder.createAttributeValueType(principal.getName());
        AttributeType subjectIdAttribute =
            RequestComponentBuilder.createAttributeType(
                    XACMLConstants.SUBJECT_ID,
                    XACMLConstants.XS_STRING,
                    issuer,
                    Collections.singletonList(subjectIdAttributeValue)
            );
        attributes.add(subjectIdAttribute);
       
        if (roles != null) {
            List<AttributeValueType> roleAttributes = new ArrayList<AttributeValueType>();
            for (String role : roles) {
                if (role != null) {
                    AttributeValueType subjectRoleAttributeValue =
                        RequestComponentBuilder.createAttributeValueType(role);
                    roleAttributes.add(subjectRoleAttributeValue);
                }
            }
           
            if (!roleAttributes.isEmpty()) {
                AttributeType subjectRoleAttribute =
                    RequestComponentBuilder.createAttributeType(
                            XACMLConstants.SUBJECT_ROLE,
                            XACMLConstants.XS_ANY_URI,
                            issuer,
                            roleAttributes
                    );
                attributes.add(subjectRoleAttribute);
            }
        }
        SubjectType subjectType = RequestComponentBuilder.createSubjectType(attributes, null);
       
        // Resource
        ResourceType resourceType = createResourceType(message);
       
        // Action
        AttributeValueType actionAttributeValue =
            RequestComponentBuilder.createAttributeValueType(actionToUse);
        AttributeType actionAttribute =
            RequestComponentBuilder.createAttributeType(
                    XACMLConstants.ACTION_ID,
                    XACMLConstants.XS_STRING,
                    null,
                    Collections.singletonList(actionAttributeValue)
            );
        attributes.clear();
        attributes.add(actionAttribute);
        ActionType actionType = RequestComponentBuilder.createActionType(attributes);
       
        // Environment
        attributes.clear();
        if (sendDateTime) {
            DateTime dateTime = new DateTime();
            AttributeValueType environmentAttributeValue =
                RequestComponentBuilder.createAttributeValueType(dateTime.toString());
            AttributeType environmentAttribute =
                RequestComponentBuilder.createAttributeType(
                        XACMLConstants.CURRENT_DATETIME,
                        XACMLConstants.XS_DATETIME,
                        null,
                        Collections.singletonList(environmentAttributeValue)
View Full Code Here

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

     *
     * @param roleName
     * @return
     */
    public static AttributeType createAttributeForRole(String roleName) {
        AttributeType att = new AttributeType("role");
        att.setFriendlyName("role");
        att.setNameFormat(JBossSAMLURIConstants.ATTRIBUTE_FORMAT_BASIC.get());

        // rolename
        att.addAttributeValue(roleName);

        return att;
    }
View Full Code Here

Examples of org.tinyradius.dictionary.AttributeType

    if (typeName == null || typeName.length() == 0)
      throw new IllegalArgumentException("type name is empty");
    if (value == null || value.length() == 0)
      throw new IllegalArgumentException("value is empty");
   
    AttributeType type = dictionary.getAttributeTypeByName(typeName);
    if (type == null)
      throw new IllegalArgumentException("unknown attribute type '" + typeName + "'");

    RadiusAttribute attribute = RadiusAttribute.createRadiusAttribute(getDictionary(), type.getVendorId(), type.getTypeCode());
    attribute.setAttributeValue(value);
    addAttribute(attribute);
  }
View Full Code Here

Examples of org.tinyradius.dictionary.AttributeType

   */
  public RadiusAttribute getAttribute(String type) {
    if (type == null || type.length() == 0)
      throw new IllegalArgumentException("type name is empty");
   
    AttributeType t = dictionary.getAttributeTypeByName(type);
    if (t == null)
      throw new IllegalArgumentException("unknown attribute type name '" + type + "'");
   
    return getAttribute(t.getVendorId(), t.getTypeCode());
  }
View Full Code Here

Examples of org.tinyradius.dictionary.AttributeType

   * Tries to resolve enumerations.
   * @see org.tinyradius.attribute.RadiusAttribute#getAttributeValue()
   */
  public String getAttributeValue() {
    int value = getAttributeValueInt();
    AttributeType at = getAttributeTypeObject();
    if (at != null) {
      String name = at.getEnumeration(value);
      if (name != null)
        return name;
    }

    return Integer.toString(value);
View Full Code Here

Examples of org.tinyradius.dictionary.AttributeType

   * Sets the value of this attribute.
   * @exception NumberFormatException if value is not a number and constant cannot be resolved
   * @see org.tinyradius.attribute.RadiusAttribute#setAttributeValue(java.lang.String)
   */
  public void setAttributeValue(String value) {
    AttributeType at = getAttributeTypeObject();
    if (at != null) {
      Integer val = at.getEnumeration(value);
      if (val != null) {
        setAttributeValue(val.intValue());
        return;
      }
    }
View Full Code Here

Examples of org.tinyradius.dictionary.AttributeType

   */
  public String toString() {
    String name;
   
    // determine attribute name
    AttributeType at = getAttributeTypeObject();
    if (at != null)
      name = at.getName();
    else if (getVendorId() != -1)
      name = "Unknown-Sub-Attribute-" + getAttributeType();
    else
      name = "Unknown-Attribute-" + getAttributeType();
   
View Full Code Here

Examples of org.tinyradius.dictionary.AttributeType

   * @return RadiusAttribute object
   */
  public static RadiusAttribute createRadiusAttribute(Dictionary dictionary, int vendorId, int attributeType) {
    RadiusAttribute attribute = new RadiusAttribute();
   
    AttributeType at = dictionary.getAttributeTypeByCode(vendorId, attributeType);
    if (at != null && at.getAttributeClass() != null) {
      try {
        attribute = (RadiusAttribute)at.getAttributeClass().newInstance();
      } catch (Exception e) {
        // error instantiating class - should not occur
      }
    }
   
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.