Skip to navigation

Begin SSO authentication flow

View as Markdown

Initiates the OpenID Connect authentication flow by redirecting to the authorization server.

This endpoint begins the standard OpenID Connect authentication flow:

  1. The client calls this endpoint with a callback path
  2. The server responds with a redirect to the identity provider
  3. The user authenticates with the identity provider
  4. The identity provider redirects back to the callback endpoint
  5. The client can then exchange the authorization code for an access token

Usage Example

// Browser-based flow
fetch('/v1/sso_authentication', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
database: 'retail_analytics',
sso_callback_path: '/auth/callback'
})
})
.then(response => {
// The browser will be redirected to the SSO provider
window.location.href = response.url;
});

Request

This endpoint expects an object.
databasestringOptional

Target database name (defaults to system if not specified)

sso_callback_pathstringOptionalformat: "uri"
Local path to redirect to after successful authentication. This path should be registered with your OpenID provider as a valid redirect URI.
do_redirectbooleanOptionalDefaults to true

Whether to issue the redirect to the authentication server immediately.

  • If true (default), the API will respond with a 302 redirect to the OpenID provider
  • If false, the API will return the URL in the response body, allowing the client to handle the redirect manually

If SSO is not configured for the database, an error will occur if do_redirect is true, or an empty redirect will be returned if do_redirect is false.

Errors

401
Unauthorized Error
404
Not Found Error