Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Warning
  1. To use the Authorization Code grant type (Refresh token grant type) or the Client Credentials grant type you need to have WUM update level 1618940493641 or U2 EI 6.6.0.23.
  2. To use the Password grant type you need to have WUM update level 1631543692764 or U2 EI 6.6.0.56.
Table of Contents
maxLevel6
minLevel6
Authorization Code and Refresh token grant type

The authorizationCode element contains the following parameters that are used to configure OAuth for the endpoint. All of the following attributes are required.

...

Code Block
<endpoint name="FoodEP" xmlns="http://ws.apache.org/ns/synapse">
    <http method="get" uri-template="http://localhost:9192/service/foodservice">
        <authentication>
            <oauth>
                <authorizationCode>
                    <clientId>K2RbnGP7VS</clientId>
                    <clientSecret>9zLrZAYR5b</clientSecret>
                    <refreshToken>y2Ne4Fccrj</refreshToken>
                    <tokenUrl>http://localhost:8678/token</tokenUrl>
                </authorizationCode>
            </oauth>
        </authentication>
    </http>
</endpoint>


Client credentials grant type

The clientCredentials element contains the following parameters that are used to configure OAuth for the endpoint. All of the following attributes are required.

Property NameDescription
clientIdThe Client ID provided by the service when you register your application.
clientSecretThe Client Secret provided by the service when you register your application.
tokenUrlThe token endpoint URL given by the service to obtain the access tokens.

An example is shown below.

Code Block
<endpoint name="FoodEP" xmlns="http://ws.apache.org/ns/synapse">
    <http method="get" uri-template="http://localhost:9192/service/foodservice">
        <authentication>
            <oauth>
                <clientCredentials>
                    <clientId>K2RbnGP7VS</clientId>
                    <clientSecret>9zLrZAYR5b</clientSecret>
                    <tokenUrl>http://localhost:8678/token</tokenUrl>
                </clientCredentials>
            </oauth>
        </authentication>
    </http>
</endpoint>


Password grant type

The passwordCredentials element contains the following parameters that are used to configure OAuth for the endpoint. All of the following attributes are required.