Skip to navigation

Exchange SSO token

View as Markdown

Exchange an OpenID Connect ID token or access token for an Ocient database access token.

This endpoint allows clients to directly exchange tokens without going through the full browser-based authentication flow. This is useful for server-to-server scenarios or when the client already has a valid OpenID token from another flow.

Example

curl -X POST https://your-ocient-instance/v1/sso_token \
-H "Content-Type: application/json" \
-d '{
"id_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
"database": "retail_analytics"
}'

Request

This endpoint expects any.
anyRequired
OR
anyRequired

Response

Token exchange successful
access_tokenstring

Access token for subsequent API calls. This token should be included in the Authorization header for all authenticated requests using the format: Authorization: Bearer {token}.

statusobjectRead-only
Status information about the login operation. A successful login will have a SQL state of "00000".
usernamestringOptional
The authenticated user's username. This is useful for displaying in UIs or for audit logging purposes.
databasestringOptional
The database that was authenticated against. This is the default database for subsequent queries if none is specified.
expires_inintegerOptional
Number of seconds until the access token expires. Clients should refresh the token before this time to maintain uninterrupted access.

Errors

401
Unauthorized Error