Skip to main content

Authentication

Authenticate with the OAuth2 Client Credentials Flow.

You will receive a client_id and client_secret.

caution

Always keep your client_secret secure.

Use these credentials to generate a bearer token for the Authorization request header which authenticates your requests to the Consensys Staking API.

To generate a token, use an HTTP request with your credentials. For example:

curl --request POST \
--url https://codefi-staking-dev.eu.auth0.com/oauth/token \
--header 'content-type: application/json' \
--data '{"client_id":"YOUR_CLIENT_ID","client_secret":"YOUR_CLIENT_SECRET","audience":"https://yucatan.staking-dev.codefi.network/","grant_type":"client_credentials"}'

Store the access_token in the response and use it in subsequent requests to our API in the HTTP header:

Authorization: "Bearer ACCESS_TOKEN"