Skip to content

Start signing in with a provider

POST
/api/v1/auth/providers/{providerId}/authorize
curl --request POST \
--url http://localhost:8080/api/v1/auth/providers/example/authorize \
--header 'Content-Type: application/json' \
--data '{ "redirectUri": "https://example.com", "codeChallenge": "example" }'

Returns the provider’s sign-in page. Open it in a browser, such as ASWebAuthenticationSession. After signing in, the browser is sent to redirectUri with a one-time code, or with error and error_description when sign-in failed. Trade the code for a session with exchangeSignInCode within 5 minutes. The person has 10 minutes to sign in at the provider.

providerId
required
string
/^[a-z0-9-]{1,32}$/
Media typeapplication/json
object
redirectUri
required

Where to send the browser after sign-in. Must start with the server’s public URL or a prefix in CHEK_OIDC_REDIRECTS (chek:// by default).

string format: uri
codeChallenge
required

The base64url SHA-256 of a random PKCE code verifier (RFC 7636 S256), without padding.

string
>= 43 characters <= 43 characters

Example generated

{
"redirectUri": "https://example.com",
"codeChallenge": "example"
}

The page to open.

Media typeapplication/json
object
url
required

The provider’s sign-in page.

string format: uri

Example generated

{
"url": "https://example.com"
}

The request was malformed.

Media typeapplication/json
object
code
required
string
Allowed values: bad_request unauthorized forbidden not_found unavailable scan_in_progress content_changed already_set_up name_taken last_admin progress_conflict too_many_attempts not_linked identity_taken last_sign_in provider_unavailable too_many_sign_ins repository_exists repository_not_allowed repository_unreadable repository_needs_token repository_needs_password repository_needs_credentials repository_credentials_refused extension_invalid source_failed source_unavailable source_check_failed internal
message
required

Explains the problem to a developer.

string

Example

{
"code": "bad_request"
}

The resource does not exist.

Media typeapplication/json
object
code
required
string
Allowed values: bad_request unauthorized forbidden not_found unavailable scan_in_progress content_changed already_set_up name_taken last_admin progress_conflict too_many_attempts not_linked identity_taken last_sign_in provider_unavailable too_many_sign_ins repository_exists repository_not_allowed repository_unreadable repository_needs_token repository_needs_password repository_needs_credentials repository_credentials_refused extension_invalid source_failed source_unavailable source_check_failed internal
message
required

Explains the problem to a developer.

string

Example

{
"code": "bad_request"
}

The sign-in provider couldn’t be reached (provider_unavailable).

Media typeapplication/json
object
code
required
string
Allowed values: bad_request unauthorized forbidden not_found unavailable scan_in_progress content_changed already_set_up name_taken last_admin progress_conflict too_many_attempts not_linked identity_taken last_sign_in provider_unavailable too_many_sign_ins repository_exists repository_not_allowed repository_unreadable repository_needs_token repository_needs_password repository_needs_credentials repository_credentials_refused extension_invalid source_failed source_unavailable source_check_failed internal
message
required

Explains the problem to a developer.

string

Example

{
"code": "bad_request"
}

Too many sign-ins are in progress at once (too_many_sign_ins); try again in a few minutes.

Media typeapplication/json
object
code
required
string
Allowed values: bad_request unauthorized forbidden not_found unavailable scan_in_progress content_changed already_set_up name_taken last_admin progress_conflict too_many_attempts not_linked identity_taken last_sign_in provider_unavailable too_many_sign_ins repository_exists repository_not_allowed repository_unreadable repository_needs_token repository_needs_password repository_needs_credentials repository_credentials_refused extension_invalid source_failed source_unavailable source_check_failed internal
message
required

Explains the problem to a developer.

string

Example

{
"code": "bad_request"
}