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
Body parameters
Required when
grant_type=authorization_code. The Authorization Code received from /oauth/authorize.Required when
grant_type=authorization_code. Must exactly match the URI used in the Authorization Code request.PKCE code verifier. Required if a
code_challenge was provided in the Authorization Code request.Response
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"
}

