Generate Authentication Token

This page details how to generate an OAuth token to access the different API calls. Thredd uses HTTP authentication on requests. This means that the standard Authorization field needs to be included in the header for holding authentication credentials so that the request will work. See below for an example of the header for the Create Card endpoint.

curl --request POST \
     --url https://cardsapi-uat-pub.globalprocessing.net/api/v1/cards \
     --header 'accept: application/json' \
     --header 'authorization: Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IjE5ODI3Q0E4M0NEMkNGNUUzMTAxMUVBQkQ0N0ZDNTg4RkMyRjQ3RTIiLCJ0eXAiOiJhdCtqd3QiLCJ4NXQiOiJHWUo4cUR6U3oxNHhBUjZyMUhfRmlQd3ZSLUkifQ.eyJuYmYiOjE2OTQwMDM4NzEsImV4cCI6MTY5NDAxODI3MSwiaXNzIjoiaHR0cHM6Ly91eGFzdHNhcGkuZ2xvYmFscHJvY2Vzc2luZy5uZXQiLCJhdWQiOlsiY2xhaW1zYXBpIiwiY29yZWFwaSIsImN0c2xpdGUiLCJkYWxhcGkiLCJtZGVzcnR0YXBpIiwicmVsYXlhcGkiXSwiY2xpZW50X2lkIjoiYWQ2OTcxOWUtMzgwZC00YTI1LTkwNGUtMGY5NzA4M2M2ZGZmIiwic2NvcGUiOlsiY2xhaW1zYXBpIiwiY29yZWFwaSIsImN0c2xpdGUiLCJkYWxhcGkiLCJtZGVzcnR0YXBpIiwicmVsYXlhcGkiXX0.DMNJIsNpx8PSEGjJprFZ3LEXXqLDW3Lcf93Z3W07nxP237hEqhyaH1C-s5kvoi0nUVOEo67-lp78k-TtogvLR58akcTk-wMSQfibUDXQaDAgCw_rUZvMUB6pkshlVWVLQyr-CRANmNFbaU3dipBE8F8B4fsJgN5M2K8VuB5NIuxuyMsp_8BDsB0aXz1rIsZeMiE_5r-jbBYO_uPGe2Rt1fkg4h-erV4a_V7hKbl4J272RWhbupPcI0dAw1w-OXAeMhjVIYOoSdVEILhUt4edZ1zw5kFbWLbGM-pvLWm4m-Ih3g68vHZj08Oaqh1SsPJXEsc-EZvTnTsbwvd9LrRgDA' \
     --header 'content-type: application/*+json' \
     --data '

An authentication is generated using the Retrieve Access Token endpoint.

https://oauthuat.globalprocessing.net/connect/token

The request body must include three fields:

  • A unique client ID
  • A unique client secret
  • The grant type

The client ID and client secret can be obtained from your Implementations Manager and will be unique to the environment you're accessing. The grant_type field should be set to client_credentials. See the below request body example:

curl --request POST \
     --url https://oauthuat.globalprocessing.net/connect/token \
     --header 'accept: */*' \
     --header 'content-type: application/x-www-form-urlencoded' \
     --data grant_type=client_credentials \
     --data client_id=ad69719e-380d-4a25-904e-0f97083c6dff \
     --data 'client_secret=bUA1hgyG1go3M4mULg9aGHP4Dh6qGoVCE3v68AylupdaqKUexXCqQK2tR7Qkq5gselnrspF8C0/RShWLmE6Lo+RHODv3OyDLly5xIPyLmhs+GceeCLh8EPXp4oPEU/yL7iAy02GcfOe2yTuDhQYGvGrWFdp8rSy5foFVuCfoZK4='

A successful request will return a 200 response and a valid OAuth token.

{
    "access_token": "eyJhbGciOiJSUzI1NiIsImtpZCI6IjE5ODI3Q0E4M0NEMkNGNUUzMTAxMUVBQkQ0N0ZDNTg4RkMyRjQ3RTIiLCJ0eXAiOiJhdCtqd3QiLCJ4NXQiOiJHWUo4cUR6U3oxNHhBUjZyMUhfRmlQd3ZSLUkifQ.eyJuYmYiOjE2OTQwMDU4NTcsImV4cCI6MTY5NDAyMDI1NywiaXNzIjoiaHR0cHM6Ly9vYXV0aHVhdC5nbG9iYWxwcm9jZXNzaW5nLm5ldCIsImF1ZCI6WyJjbGFpbXNhcGkiLCJjb3JlYXBpIiwicmVsYXlhcGkiXSwiY2xpZW50X2lkIjoiZ3BzdGVzdHVhdDAxIiwic2NvcGUiOlsiY2xhaW1zYXBpIiwiY29yZWFwaSIsInJlbGF5YXBpIl19.cQFQ4Po8UPloy9wKqzfx9R6Y-ZzrtD2V3cmw788T4L50kQcXgA4R3PZkYs6IyUUAAozXBFGyhjren4qvXWUbmjXYq5dEVBY9VasrP8R9TVPRRF8nl2THDHBl6ssvv8okWjsZKRDsncIjVWKYwvjx96Xc_egtPzvYFXzVQqbQmFcYgX0067JMlgh2oML9VFiQOxjgnp9RYdZvYAAj-25LFGuqPH92lKrOGUv3_EnHskpQhbu8JkuwyHWfsySUSh8Wxl1rX0eikVPR5APRvwKfjUWWe1XUy51dLwieuvAITKyUa1LA2oUVEaFLXx_Kp3ZKLa2zX5L9jx-1nPylkjMshg",
    "expires_in": 14400,
    "token_type": "Bearer",
    "scope": "claimsapi coreapi relayapi"
}

Expiration of Token

Tokens will expire four hours after being generated. If a token has expired when performing a request against an endpoint, a 401 error will be returned and a new OAuth token will need to be generated.

👍

API Explorer

See the Retrieve access token endpoint.