Skip to content
GitHubLog inStart free
cetra is not released yet. These docs describe the development version.

Start an OAuth or OIDC login

GET
/api/auth/authorize/{provider}
curl --request GET \
--url http://localhost:8080/api/auth/authorize/example

Redirects to the provider and sets the cetra_oauth cookie. redirect is kept when it starts with /, does not start with // or /\, is at most 1024 bytes, and contains no ASCII control character. Otherwise the browser returns to /. An unknown provider is 404. When metadata cannot be loaded, the response redirects to /login?error=provider_unavailable and sets no cookie.

provider
required
string

Provider id: github, google, or oidc:<name>.

redirect
string

Relative path to open after a successful login.

setup_token
string

First-run setup token. Stored in the login cookie and accepted only while no user exists.

Redirect to the provider, or to /login?error=provider_unavailable.

The resource does not exist.

Media typeapplication/problem+json

RFC 7807 problem document.

Spec 09 § Conventions.

object
code
required

Machine-readable error code.

string
Allowed values: bad_request invalid_filter query_failed query_timeout query_too_large too_many_traces too_many_items busy restore_mode unauthorized forbidden sso_required email_not_verified plan_limit plan_required scim_managed owner_not_allowed not_found method_not_allowed payload_too_large unsupported_media_type range_not_satisfiable conflict authorization_pending slow_down access_denied expired_token quota_exceeded rate_limited internal
detail

Extra explanation. Omitted when absent.

string
errors

Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.

Array<object>

One field that failed validation.

Spec 09 § Conventions.

object
field
required

Request field, query parameter, or expression the error refers to.

string
message
required

What is wrong with the field.

string
position

Location inside the field value, for filter and SQL errors.

object
column
required

1-based column number, in characters.

integer format: int32
line
required

1-based line number, in characters.

integer format: int32
status
required

HTTP status code.

integer format: int32
title
required

Short human-readable summary, the reason phrase of status.

string
type
required

Problem type URI. Always about:blank in this version.

string

Example

{
"code": "bad_request"
}