Exchange a GitHub Actions OIDC token for a short-lived API key (15 minutes)
POST
/auth/github-oidc
const url = 'https://api.krakenkey.io/auth/github-oidc';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"token":"example","trustId":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.krakenkey.io/auth/github-oidc \ --header 'Content-Type: application/json' \ --data '{ "token": "example", "trustId": "example" }'Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
token
required
GitHub Actions OIDC token (JWT)
string
trustId
Trust policy id; needed only when several policies match the repository
string
Examplegenerated
{ "token": "example", "trustId": "example"}Responses
Section titled “Responses”Short-lived API key
Token invalid, expired or for another audience
No trust policy matches the repository, ref and environment
Several trust policies match; pass trustId