Sign in with an OAuth2 provider
GET /signin/provider/{provider}
Initiate OAuth2 authentication flow with a social provider. Redirects the user to the provider’s authorization page.
If the user doesn’t exist and AUTH_DISABLE_AUTO_SIGNUP is not set, a new account will be created upon callback.
When AUTH_DISABLE_AUTO_SIGNUP is enabled, users must use the /signup/provider/{provider} endpoint to register first.
Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”The name of the social provider
Query Parameters
Section titled “Query Parameters ”Example
[ "me", "user"]Array of allowed roles for the user
Example
userDefault role for the user
Example
John SmithDisplay name for the user
Example
enA two or three characters locale
object
Example
{ "firstName": "John", "lastName": "Smith"}Additional metadata for the user (JSON encoded string)
Example
https://my-app.com/catch-redirectionURI to redirect to
If set, this means that the user is already authenticated and wants to link their account. This needs to be a valid JWT access token.
Opaque state value to be returned by the provider
Additional provider-specific parameters
object
(workos) Specifies the connection to use for authentication
(workos) Specifies the organization to use for authentication
PKCE code challenge (S256). When provided, the callback redirect will contain an authorization code instead of a refresh token.
Responses
Section titled “ Responses ”Redirect to social provider
Headers
Section titled “Headers ”URL to redirect to
default
Section titled “default ”An error occurred while processing the request
Standardized error response
object
HTTP status error code
Example
400Human-friendly error message
Example
Invalid email formatError code identifying the specific application error