Operations for the SSO API.
Summary
Functions
Logout Authorize
Delete a Connection
Initiate SSO
Get a Connection
Logout Redirect
Get a User Profile
Get a Profile and Token
List Connections
Functions
@spec authorize_logout(WorkOS.Client.t(), map(), keyword()) :: {:ok, WorkOS.SSOLogoutAuthorizeResponse.t()} | {:error, WorkOS.Error.error()}
Logout Authorize
You should call this endpoint from your server to generate a logout token which is required for the Logout Redirect endpoint.
Parameters
params— request body mapopts— per-request options (seeWorkOS.Client.request/5)
@spec delete_connection(WorkOS.Client.t(), String.t(), keyword()) :: {:ok, term()} | {:error, WorkOS.Error.error()}
Delete a Connection
Permanently deletes an existing connection. It cannot be undone.
Parameters
id— Unique identifier for the Connection.opts— per-request options (seeWorkOS.Client.request/5)
@spec get_authorization_url(WorkOS.Client.t(), map()) :: String.t()
Initiate SSO
Initiates the single sign-on flow.
Returns the fully-qualified redirect URL — no HTTP request is made.
Sets response_type ("code") automatically.
Reads client_id from the client configuration unless passed explicitly.
Parameters
params— query parameters::provider_scopes,:provider_query_params,:domain(deprecated),:provider,:redirect_uri,:state,:connection,:organization,:domain_hint,:login_hint,:nonce,:prompt
@spec get_connection(WorkOS.Client.t(), String.t(), keyword()) :: {:ok, WorkOS.Connection.t()} | {:error, WorkOS.Error.error()}
Get a Connection
Get the details of an existing connection.
Parameters
id— Unique identifier for the Connection.opts— per-request options (seeWorkOS.Client.request/5)
@spec get_logout_url(WorkOS.Client.t(), map()) :: String.t()
Logout Redirect
Logout allows to sign out a user from your application by triggering the identity provider sign out flow. This GET endpoint should be a redirection, since the identity provider user will be identified in the browser session.
Before redirecting to this endpoint, you need to generate a short-lived logout token using the Logout Authorize endpoint.
Returns the fully-qualified redirect URL — no HTTP request is made.
Parameters
params— query parameters::token
@spec get_profile( WorkOS.Client.t(), keyword() ) :: {:ok, WorkOS.Profile.t()} | {:error, WorkOS.Error.error()}
Get a User Profile
Exchange an access token for a user's Profile. Because this profile is returned in the Get a Profile and Token endpoint your application usually does not need to call this endpoint. It is available for any authentication flows that require an additional endpoint to retrieve a user's profile.
Parameters
opts— per-request options (seeWorkOS.Client.request/5)
@spec get_profile_and_token(WorkOS.Client.t(), map(), keyword()) :: {:ok, WorkOS.SSOTokenResponse.t()} | {:error, WorkOS.Error.error()}
Get a Profile and Token
Get an access token along with the user Profile using the code passed to your Redirect URI.
Sets grant_type ("authorization_code") automatically.
Reads client_id/client_secret from the client configuration unless passed explicitly.
Parameters
params— request body mapopts— per-request options (seeWorkOS.Client.request/5)
@spec list_connections(WorkOS.Client.t(), map(), keyword()) :: {:ok, WorkOS.Page.t(WorkOS.Connection.t())} | {:error, WorkOS.Error.error()}
List Connections
Get a list of all of your existing connections matching the criteria specified.
Parameters
params— query parameters::before,:after_,:limit,:order,:connection_type,:domain,:organization_id,:searchopts— per-request options (seeWorkOS.Client.request/5)