Start an OAuth or OIDC login
const url = 'http://localhost:8080/api/auth/authorize/example';const options = {method: 'GET'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url http://localhost:8080/api/auth/authorize/exampleRedirects 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.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Provider id: github, google, or oidc:<name>.
Query Parameters
Section titled “Query Parameters”Relative path to open after a successful login.
First-run setup token. Stored in the login cookie and accepted only while no user exists.
Responses
Section titled “Responses”Redirect to the provider, or to /login?error=provider_unavailable.
The resource does not exist.
RFC 7807 problem document.
Spec 09 § Conventions.
object
Machine-readable error code.
Extra explanation. Omitted when absent.
Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.
One field that failed validation.
Spec 09 § Conventions.
object
Request field, query parameter, or expression the error refers to.
What is wrong with the field.
Location inside the field value, for filter and SQL errors.
object
1-based column number, in characters.
1-based line number, in characters.
HTTP status code.
Short human-readable summary, the reason phrase of status.
Problem type URI. Always about:blank in this version.
Example
{ "code": "bad_request"}