...
This feature allows users to configure the following OAuth grant types for HTTP endpoints. You can use either Authorization Code grant type (Refresh token grant type), Client Credentials grant type or Password grant type depending on your preferred third-party service.
Table of Contents | ||||
---|---|---|---|---|
|
Note |
---|
You can use expressions (xpath or json path) to set these properties for. Refer Define Dynamic Expressions below for more details. |
Warning |
---|
|
...
Authorization Code and Refresh token 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.
Property Name | Description |
---|---|
clientId | The Client ID provided by the service when you register your application. |
clientSecret | The Client Secret provided by the service when you register your application. |
username | Username of the user. |
password | Password of the user. |
tokenUrl | The token endpoint URL given by the service to obtain the access tokens. |
Code Block |
---|
<endpoint name="FoodEP" xmlns="http://ws.apache.org/ns/synapse"> <http method="get" uri-template="http://localhost:9192/service/foodservice"> <authentication> <oauth> <passwordCredentials> <clientId>clientId</clientId> <clientSecret>clientSecret</clientSecret> <username>internal-user</username> <password>abc@123</password> <tokenUrl>oauthServerUrl</tokenUrl> </passwordCredentials> </oauth> </authentication> </http> </endpoint> |
...