curl --request POST \
--url 'https://oauth.msu.io/oauth/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Basic base64({CLIENT_ID}:{CLIENT_SECRET})' \
--data 'grant_type=authorization_code&code={AUTHORIZATION_CODE}&redirect_uri={REDIRECT_URI}'
curl --request POST \
--url 'https://oauth.msu.io/oauth/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Basic base64({CLIENT_ID}:{CLIENT_SECRET})' \
--data 'grant_type=refresh_token&refresh_token={REFRESH_TOKEN}'
const response = await fetch('https://oauth.msu.io/oauth/token', {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Authorization': `Basic ${btoa('{CLIENT_ID}:{CLIENT_SECRET}')}`
},
body: new URLSearchParams({
grant_type: 'authorization_code',
code: '{AUTHORIZATION_CODE}',
redirect_uri: '{REDIRECT_URI}'
})
});
const data = await response.json();
import requests
import base64
credentials = base64.b64encode(b'{CLIENT_ID}:{CLIENT_SECRET}').decode()
response = requests.post(
'https://oauth.msu.io/oauth/token',
headers={
'Content-Type': 'application/x-www-form-urlencoded',
'Authorization': f'Basic {credentials}'
},
data={
'grant_type': 'authorization_code',
'code': '{AUTHORIZATION_CODE}',
'redirect_uri': '{REDIRECT_URI}'
}
)
data = response.json()
{
"access_token": "eyJhbGciOiJSUzI1NiIsImtpZCI6Im1zdS1vYXV0aCIsInR5cCI6IkpXVCJ9...",
"token_type": "Bearer",
"expires_in": 600,
"refresh_token": "eyJhbGciOiJSUzI1NiIsImtpZCI6Im1zdS1vYXV0aCIsInR5cCI6IkpXVCJ9...",
"scope": "enhancement"
}
Oauth
Token Issuance & Refresh
Issue a new Access Token and Refresh Token using an Authorization Code, or refresh an expired Access Token using a Refresh Token.
POST
/
oauth
/
token
curl --request POST \
--url 'https://oauth.msu.io/oauth/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Basic base64({CLIENT_ID}:{CLIENT_SECRET})' \
--data 'grant_type=authorization_code&code={AUTHORIZATION_CODE}&redirect_uri={REDIRECT_URI}'
curl --request POST \
--url 'https://oauth.msu.io/oauth/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Basic base64({CLIENT_ID}:{CLIENT_SECRET})' \
--data 'grant_type=refresh_token&refresh_token={REFRESH_TOKEN}'
const response = await fetch('https://oauth.msu.io/oauth/token', {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Authorization': `Basic ${btoa('{CLIENT_ID}:{CLIENT_SECRET}')}`
},
body: new URLSearchParams({
grant_type: 'authorization_code',
code: '{AUTHORIZATION_CODE}',
redirect_uri: '{REDIRECT_URI}'
})
});
const data = await response.json();
import requests
import base64
credentials = base64.b64encode(b'{CLIENT_ID}:{CLIENT_SECRET}').decode()
response = requests.post(
'https://oauth.msu.io/oauth/token',
headers={
'Content-Type': 'application/x-www-form-urlencoded',
'Authorization': f'Basic {credentials}'
},
data={
'grant_type': 'authorization_code',
'code': '{AUTHORIZATION_CODE}',
'redirect_uri': '{REDIRECT_URI}'
}
)
data = response.json()
{
"access_token": "eyJhbGciOiJSUzI1NiIsImtpZCI6Im1zdS1vYXV0aCIsInR5cCI6IkpXVCJ9...",
"token_type": "Bearer",
"expires_in": 600,
"refresh_token": "eyJhbGciOiJSUzI1NiIsImtpZCI6Im1zdS1vYXV0aCIsInR5cCI6IkpXVCJ9...",
"scope": "enhancement"
}
Issues a new Access Token and Refresh Token using an Authorization Code (
authorization_code), or refreshes an expired Access Token using a Refresh Token (refresh_token).
Header parameters
string
required
Must be
application/x-www-form-urlencoded.string
required
Client credentials encoded in Base64:
Basic base64({CLIENT_ID}:{CLIENT_SECRET}).Body parameters
string
required
Token grant type. Must be
authorization_code or refresh_token.string
Required when
grant_type=authorization_code. The Authorization Code received from /oauth/authorize.string
Required when
grant_type=authorization_code. Must exactly match the URI used in the Authorization Code request.string
Required when
grant_type=refresh_token. The Refresh Token to use for renewal.string
PKCE code verifier. Required if a
code_challenge was provided in the Authorization Code request.Response
string
Access Token. Used as a Bearer token in API calls.
string
Token type. Always
Bearer.integer
Access Token validity period in seconds (600 seconds = 10 minutes).
string
Refresh Token. Used to renew the Access Token. Valid for 3 hours.
string
Space-separated list of granted permission scopes.
curl --request POST \
--url 'https://oauth.msu.io/oauth/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Basic base64({CLIENT_ID}:{CLIENT_SECRET})' \
--data 'grant_type=authorization_code&code={AUTHORIZATION_CODE}&redirect_uri={REDIRECT_URI}'
curl --request POST \
--url 'https://oauth.msu.io/oauth/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Basic base64({CLIENT_ID}:{CLIENT_SECRET})' \
--data 'grant_type=refresh_token&refresh_token={REFRESH_TOKEN}'
const response = await fetch('https://oauth.msu.io/oauth/token', {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Authorization': `Basic ${btoa('{CLIENT_ID}:{CLIENT_SECRET}')}`
},
body: new URLSearchParams({
grant_type: 'authorization_code',
code: '{AUTHORIZATION_CODE}',
redirect_uri: '{REDIRECT_URI}'
})
});
const data = await response.json();
import requests
import base64
credentials = base64.b64encode(b'{CLIENT_ID}:{CLIENT_SECRET}').decode()
response = requests.post(
'https://oauth.msu.io/oauth/token',
headers={
'Content-Type': 'application/x-www-form-urlencoded',
'Authorization': f'Basic {credentials}'
},
data={
'grant_type': 'authorization_code',
'code': '{AUTHORIZATION_CODE}',
'redirect_uri': '{REDIRECT_URI}'
}
)
data = response.json()
{
"access_token": "eyJhbGciOiJSUzI1NiIsImtpZCI6Im1zdS1vYXV0aCIsInR5cCI6IkpXVCJ9...",
"token_type": "Bearer",
"expires_in": 600,
"refresh_token": "eyJhbGciOiJSUzI1NiIsImtpZCI6Im1zdS1vYXV0aCIsInR5cCI6IkpXVCJ9...",
"scope": "enhancement"
}

