AccessToken XML Element Reference

The AccessToken element lets you customize the acquisition of an access token in the OAuth flow. A way to get expire time is to use TokenProcessor, which can handle the input data and return standard JSON data. A MessageValue can be used to retrieve from the response body, because the valid response is in FORM format. By retrieving access token and expire time from MessageValue, the token processor can return standard parameters that conforms to RFC 6749 and JSON format.

XML Schema of the Element

  <xs:element name="AccessToken" minOccurs="0">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="RequestMsgStyle" minOccurs="0"/>
        <xs:element ref="ResponseMsgStyle" minOccurs="0"/>
        <xs:element ref="ExpireTime" minOccurs="0"/>
        <xs:element ref="TokenProcessor" minOccurs="0"/>
      </xs:sequence>
    </xs:complexType>
</xs:element>

Sequence Element

Description of Values

RequestMsgStyle

According to RFC 6749, the default value is FORM for Authorization Code Grant, Client Credentials Grant, Resource Owner Password Credentials Grant, and Customized Flow.

<xs:element name="RequestMsgStyle" minOccurs="0">
    <xs:simpleType>
      <xs:restriction base="xs:string">
        <xs:enumeration value="FORM"/>
        <xs:enumeration value="QUERY"/>
        <xs:enumeration value="QUERYPOST"/>
      </xs:restriction>
    </xs:simpleType>
  </xs:element>
QUERY—Append all request parameters of OAuth to the URL as a query string, using the HTTP GET method.
QUERYPOST—Add all request parameters of OAuth to URL as query string, using the HTTP POST method.
FORM—Add all request parameters of OAuth to the request body, using a Content-Type of application/x-www-form-urlencoded.

ResponseMsgStyle

According to RFC 6749, the default value is JSON for Authorization Code Grant, Client Credentials Grant, Resource Owner Password Credentials Grant, and Customized Flow.

<xs:element name="ResponseMsgStyle" minOccurs="0">
    <xs:simpleType>
      <xs:restriction base="xs:string">
        <xs:enumeration value="FORM"/>
        <xs:enumeration value="QUERY"/>
        <xs:enumeration value="JSON"/>
        <xs:enumeration value="RAWBODY"/>
      </xs:restriction>
    </xs:simpleType>
  </xs:element>
QUERY—All response parameters of OAuth are returned as a query string appended to a redirect URL.
FORM—All response parameters of OAuth are returned with the entity, and Content-Type is application/x-www-form-urlencoded.
JSON—All response parameters of OAuth are returned with the entity, and Content-Type is application/json.
RAWBODY—All response parameters of OAuth are returned with the entity, but the format is not clearly defined. In this case, use tokenProcessor(JavaScript) to retrieve all parameters.

ExpireTime

Sets an expiration time for the access token, overriding the default time of 5 seconds.

XML Schema of the Element

  <xs:element name="ExpireTime" minOccurs="0">
    <xs:simpleType>
      <xs:restriction base="xs:integer"/>
    </xs:simpleType>
  </xs:element>

TokenProcessor

Gets tokens or other parameters if the authorization response is not in the specified format.

XML Schema of the Element

  <xs:element name="TokenProcessor" minOccurs="0">
    <xs:simpleType>
      <xs:restriction base="xs:string"/>
    </xs:simpleType>
  </xs:element>