Server-side OAuth2 implementation using client_secret. Use for web backends, CLI tools, and apps that can securely store credentials.
The Authorization Code flow uses a client_secret to authenticate when exchanging the authorization code for tokens. Use this flow when your application runs on a server and can securely store credentials — for example, Node.js, Python, or PHP backends.
OAuth2 client credentials — Register your app in Client Center to get client_id and client_secret
Redirect URI — Must be pre-registered in Client Center and must exactly match (protocol, host, path, trailing slashes)
Server-side runtime — Node.js 18+, Python 3.8+, or equivalent for your language
Session or secure storage — To persist state between redirect and callback, and to store tokens after exchange
The client_secret is shown only once when you create the client. Copy it immediately and store it in environment variables or a secrets manager. If lost, regenerate it in Client Center.
Redirect the user to the Aries authorization endpoint. They will see a login and consent screen where they can approve or deny the requested permissions.Endpoint:https://app.aries.com/oauth2/authorizeRequired query parameters:
After the user approves, Aries redirects to your redirect_uri with an authorization code and the state you provided. If the user denies access, you receive error parameters instead.Success callback:
Send the authorization code to the token endpoint to receive an access token and refresh token. The code is single-use — exchange it immediately after receiving it.Endpoint:POST https://api.aries.com/v1/oauth2/tokenRequest body:
Access tokens expire after expires_in seconds (typically 1 hour). Use the refresh token to obtain a new access token without requiring the user to log in again. Refresh proactively before expiry.Endpoint:POST https://api.aries.com/v1/oauth2/tokenRequest body:
Field
Required
Description
client_id
Yes
Your OAuth2 client ID
client_secret
Yes
Your OAuth2 client secret
grant_type
Yes
refresh_token
refresh_token
Yes
The refresh token from the initial exchange
redirect_uri
Yes
Must match the redirect URI used in the original flow