Exchange a GitHub Actions identity token
import requests
url = "https://platform.ankra.app/api/v1/oidc/github/token"
payload = {
"grant_type": "urn:ietf:params:oauth:grant-type:token-exchange",
"subject_token": "<string>",
"organisation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
grant_type: 'urn:ietf:params:oauth:grant-type:token-exchange',
subject_token: '<string>',
organisation_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://platform.ankra.app/api/v1/oidc/github/token', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://platform.ankra.app/api/v1/oidc/github/token \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"grant_type": "urn:ietf:params:oauth:grant-type:token-exchange",
"subject_token": "<string>",
"organisation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'{
"access_token": "<string>",
"issued_token_type": "<string>",
"token_type": "<string>",
"expires_in": 123
}Account Tokens
Exchange a GitHub Actions identity token
Exchanges a verified GitHub Actions identity token matching an organisation trust policy for a short-lived Ankra token. The subject token is the credential; no Ankra authentication is required. Repository IDs, issuer, audience and policy restrictions are verified. Rate limited per client and organisation.
POST
/
api
/
v1
/
oidc
/
github
/
token
Exchange a GitHub Actions identity token
import requests
url = "https://platform.ankra.app/api/v1/oidc/github/token"
payload = {
"grant_type": "urn:ietf:params:oauth:grant-type:token-exchange",
"subject_token": "<string>",
"organisation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
grant_type: 'urn:ietf:params:oauth:grant-type:token-exchange',
subject_token: '<string>',
organisation_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://platform.ankra.app/api/v1/oidc/github/token', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://platform.ankra.app/api/v1/oidc/github/token \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"grant_type": "urn:ietf:params:oauth:grant-type:token-exchange",
"subject_token": "<string>",
"organisation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'{
"access_token": "<string>",
"issued_token_type": "<string>",
"token_type": "<string>",
"expires_in": 123
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json