Class AuthzDetailsElement

  • All Implemented Interfaces:
    Serializable

    public class AuthzDetailsElement
    extends Object
    implements Serializable
    A class that represents an element in authorization_details which is defined in "OAuth 2.0 Rich Authorization Requests".
    Since:
    2.56
    See Also:
    Serialized Form
    • Constructor Detail

      • AuthzDetailsElement

        public AuthzDetailsElement()
    • Method Detail

      • getType

        public String getType()
        Get the type of this element.

        From "OAuth 2.0 Rich Authorization Requests":

        "The type of authorization data as a string. This field MAY define which other elements are allowed in the request. This element is REQUIRED."

        Returns:
        The type of this element.
      • setType

        public AuthzDetailsElement setType​(String type)
        Set the type of this element.

        From "OAuth 2.0 Rich Authorization Requests":

        "The type of authorization data as a string. This field MAY define which other elements are allowed in the request. This element is REQUIRED."

        Parameters:
        type - The type of this element.
        Returns:
        this object.
      • getLocations

        public String[] getLocations()
        Get the resources and/or resource servers.

        From "OAuth 2.0 Rich Authorization Requests":

        "An array of strings representing the location of the resource or resource server. These strings are typically URIs identifying the location of the RS."

        Returns:
        The resources and/or resource servers.
      • setLocations

        public AuthzDetailsElement setLocations​(String[] locations)
        Set the resources and/or resource servers.

        From "OAuth 2.0 Rich Authorization Requests":

        "An array of strings representing the location of the resource or resource server. These strings are typically URIs identifying the location of the RS."

        Parameters:
        locations - The resources and/or resource servers.
        Returns:
        this object.
      • getActions

        public String[] getActions()
        Get the actions.

        From "OAuth 2.0 Rich Authorization Requests":

        "An array of strings representing the kinds of actions to be taken at the resource."

        Returns:
        The actions.
      • setActions

        public AuthzDetailsElement setActions​(String[] actions)
        Set the actions.

        From "OAuth 2.0 Rich Authorization Requests":

        "An array of strings representing the kinds of actions to be taken at the resource."

        Parameters:
        actions - The actions.
        Returns:
        this object.
      • getDataTypes

        public String[] getDataTypes()
        Get the data types.

        From "OAuth 2.0 Rich Authorization Requests":

        "An array of strings representing the kinds of data being requested from the resource."

        Returns:
        The data types.
        Since:
        2.85
      • setDataTypes

        public AuthzDetailsElement setDataTypes​(String[] dataTypes)
        Set the data types.

        From "OAuth 2.0 Rich Authorization Requests":

        "An array of strings representing the kinds of data being requested from the resource."

        Parameters:
        dataTypes - The data types.
        Returns:
        this object.
        Since:
        2.85
      • getIdentifier

        public String getIdentifier()
        Get the identifier of a specific resource.

        From "OAuth 2.0 Rich Authorization Requests":

        "A string identifier indicating a specific resource available at the API."

        Returns:
        The identifier of a specific resource.
      • setIdentifier

        public AuthzDetailsElement setIdentifier​(String identifier)
        Set the identifier of a specific resource.

        From "OAuth 2.0 Rich Authorization Requests":

        "A string identifier indicating a specific resource available at the API."

        Parameters:
        identifier - The identifier of a specific resource.
        Returns:
        this object.
      • getPrivileges

        public String[] getPrivileges()
        Get the types or levels of privilege.

        From "OAuth 2.0 Rich Authorization Requests":

        "An array of strings representing the types or levels of privilege being requested at the resource."

        Returns:
        Types or levels of privilege.
        Since:
        2.91
      • setPrivileges

        public AuthzDetailsElement setPrivileges​(String[] privileges)
        Set the types or levels of privilege.

        From "OAuth 2.0 Rich Authorization Requests":

        "An array of strings representing the types or levels of privilege being requested at the resource."

        Parameters:
        privileges - Types or levels of privilege.
        Returns:
        this object.
        Since:
        2.91
      • getOtherFields

        public String getOtherFields()
        Get the other fields (than the pre-defined ones such as type and locations) as a string in the JSON format.

        The content varies depending on the type field.

        Returns:
        Other fields in the JSON format. This may be null.
        See Also:
        getOtherFieldsAsMap()
      • setOtherFields

        public AuthzDetailsElement setOtherFields​(String otherFields)
        Set the other fields (than the pre-defined ones such as type and locations) as a string in the JSON format.

        The content varies depending on the type field.

        Parameters:
        otherFields - Other fields in the JSON format.
        Returns:
        this object.
      • getOtherFieldsAsMap

        public Map<?,​?> getOtherFieldsAsMap()
        Get the other fields (than type, locations, actions and identifier) as a Map object.

        The content varies depending on the type field.

        Returns:
        Other fields as a Map object. This may be null.
        See Also:
        getOtherFields()
      • setOtherFieldsFromMap

        public AuthzDetailsElement setOtherFieldsFromMap​(Map<?,​?> otherFields)
        Set the other fields (than type, locations, actions and identifier) using a Map object. The internal value is stored as a string serialization of the Map object.

        The content varies depending on the type field.

        Parameters:
        otherFields - A Map instance holding other fields.
        Returns:
        this object.
        Since:
        2.99
        See Also:
        getOtherFieldsAsMap()
      • toJson

        public String toJson()
        Convert this instance into a JSON string.

        "Other fields" (the string returned from getOtherFields() are expanded into the output JSON.

        Returns:
        A JSON string that represents this instance.
        Since:
        2.57
      • fromJson

        public static AuthzDetailsElement fromJson​(String json)
        Build an AuthzDetailsElement instance from a JSON string.

        The following is an example of input JSON.

         {
           "type"      : "my_type",
           "locations" : ["loc0", "loc1"],
           "actions"   : ["act0", "act1"],
           "identifier": "my_id",
           "prop0"     : "a",
           "prop1"     : ["b", "c"],
           "prop2"     : {
             "sub0": "d",
             "sub1": ["e", "f"]
           }
         }
         
        Parameters:
        json - A JSON string.
        Returns:
        An AuthzDetailsElement instance built from the input JSON.
        Since:
        2.57