OAuth is an open protocol that supports secure authorization in a simple, standard method and decouples authentication from authorization.
Customers who choose to adopt the OAuth protocol for authorization to access CME Group APIs can follow the adoption path outlined below.
API Service Adoption Steps
Table of Content Zone | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||
Step 1In CME Customer Center, create an OAuth API ID or Convert a Basic Auth API ID to an OAuth API ID. Create an OAuth ID in CME Customer Center
Convert a Basic Auth ID to an OAuth ID in CME Customer Center
Step 2Retrieve a Token
Create a PostCreate a Post to retrieve an authentication token from the following URLs:
The CME Group token retrieval uses the Client Credentials grant type to request an access token to access a client’s own resources. Other grant types are not supported. HTTPS Header For customers using authorization header, the Base64 Encoding is required where secret is the “API ID:Password” (Base64 endcoded), as generated in Customer Center.
Access Token Request Parameters
The grant_type parameter must be set to client_credentials.
Clients must send their CME Group OAuth API ID and password in the POST request, in client_id and client_secret fields respectively: client_id=CME Group OAuth API ID client_secret=<secret> Example The following is an example authorization code request.
ResponsesSuccessful ResponseIf the request for an access token is valid, the authorization server will generate an access token and send back to the client. The response with an access token will contain the following properties:
The access token request will also include the additional Cache-Control: no-store and Pragma: no-cache HTTP headers to ensure clients do not cache this request. For example, a successful token response may look like the following:
Unsuccessful ResponseIf the access token request is invalid, such as the OAuth token endpoint URI didn’t match the one used during authorization, then the server will return an error response. Error responses are returned with an HTTP 400 or 401 status code, with error and error description parameters. The error parameter will always be one of the values listed below.
CME Group supports two optional parameters when returning an error response, error_description and error_uri. These provide more information about the error. The error_description parameter describes the circumstance of the error. The error_uri provides a link to the API documentation for information about how to correct the specific error that was encountered. The entire error response is returned as a JSON string, similar to the successful response. Below are examples of a error responses. HTTP 400 Error
HTTP 401 Error
|
...