OAuth 2.0 Authentication

OAuth 2.0 is an open standard for authorization. With Ianum® Auth, for example, you are required to use API keys, that will be used to authenticate. The credentials should be kept confidential and only use when authorized between application and Ianum® Platform authorization server.

Remember the Oauth token expires in 1 hour.

Create an Access Token

POST https://api-auth.ianum.com/v1_3/oauth/token

Exchange your keys to get an OAuth token.

Request Body

NameTypeDescription

grant_type

string

The only one supported is "client_credentials"

client_secret

string

Secret key created on you Gate Edit console

client_id

string

Gate's id received after you create your gate

{
    "access_token": "EAWkU7g...Md5lTEuj",
    "token_type": "Baerer",
    "expires_in": 3600
}

Example Code

You need to install the requests package using this command:

pip install requests==2.20.0
from requests import post, Response

url = 'https://api-auth.ianum.com/v1_3/oauth/token'
headers = {
    'Accept': 'application/json',
    'Content-Type': 'application/json'
}
body = {
    'client_id': 'gate_xxxxxxxxxxxxx',  # also the alias is accepted
    'client_secret': 'your-client-secret-key',
    'grant_type': 'client_credentials'
}

response = get(url, headers=headers, json=fields)
# print the result of the response
print(response.json())

Last updated