> For the complete documentation index, see [llms.txt](https://docs.openstad.org/openstad/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.openstad.org/openstad/technical/api/auth.md).

# Auth

## Login route

Login is done per site.

`GET /oauth/site/:SITE_ID/login`

The user is then send to the authentication server with oAuth clientId set in the siteConfig. And is authenticated through the oAuth 2.0 protocol by the auth server.

After successful authentication the Api redirects back to the Frontend / CMS with a JWT token in the url that the frontend server can use for authenticating requests.

Like so:

`X-Authorization: Bearer JWT`

Named `X-Authorization` so it won't collide with Basic Authentications headers.

Following urls can be used to get user info with the JWT token.

`GET /oauth/site/:SITE_ID/me`


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.openstad.org/openstad/technical/api/auth.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
