> For the complete documentation index, see [llms.txt](https://docs.fylr.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fylr.io/for-developers/api/endpoints/api-oauth2.md).

# /api/oauth2

OAuth2 / OpenID Connect **authorization endpoint** (RFC 6749 §3.1). This is where the browser web-app logs a user in. It authenticates the end user — by password (`auth_method=easydb`, the default; also `ldap`, `email`, `collection`), anonymously (`anonymous`, when guest login is enabled), via SAML, or with an action code — and returns an authorization response (an authorization `code`, `token` or `id_token`) by redirecting back to the client's `redirect_uri`.

Served at `/api/oauth2/auth` — **not** under `/api/v1`. No prior access token is required.

### `GET /oauth2/auth` — Begin an authorization request (interactive login).

{% openapi src="/files/kfiDjhyZfEICNBmt5f49" path="/oauth2/auth" method="get" %}
[fylr-openapi.yml](https://4100607288-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAdRFzQASDY2Elfdm3wXW%2Fuploads%2Fgit-blob-27a76749464f8079ac8ce2ee65518544084ed6fa%2Ffylr-openapi.yml?alt=media)
{% endopenapi %}

### `POST /oauth2/auth` — Submit the login form / authorization request.

{% openapi src="/files/kfiDjhyZfEICNBmt5f49" path="/oauth2/auth" method="post" %}
[fylr-openapi.yml](https://4100607288-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAdRFzQASDY2Elfdm3wXW%2Fuploads%2Fgit-blob-27a76749464f8079ac8ce2ee65518544084ed6fa%2Ffylr-openapi.yml?alt=media)
{% endopenapi %}

### `POST /oauth2/token` — Issue an access token.

{% openapi src="/files/kfiDjhyZfEICNBmt5f49" path="/oauth2/token" method="post" %}
[fylr-openapi.yml](https://4100607288-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAdRFzQASDY2Elfdm3wXW%2Fuploads%2Fgit-blob-27a76749464f8079ac8ce2ee65518544084ed6fa%2Ffylr-openapi.yml?alt=media)
{% endopenapi %}

### `POST /oauth2/revoke` — Revoke a token (logout).

{% openapi src="/files/kfiDjhyZfEICNBmt5f49" path="/oauth2/revoke" method="post" %}
[fylr-openapi.yml](https://4100607288-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAdRFzQASDY2Elfdm3wXW%2Fuploads%2Fgit-blob-27a76749464f8079ac8ce2ee65518544084ed6fa%2Ffylr-openapi.yml?alt=media)
{% endopenapi %}

### `POST /oauth2/introspect` — Introspect a token.

{% openapi src="/files/kfiDjhyZfEICNBmt5f49" path="/oauth2/introspect" method="post" %}
[fylr-openapi.yml](https://4100607288-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAdRFzQASDY2Elfdm3wXW%2Fuploads%2Fgit-blob-27a76749464f8079ac8ce2ee65518544084ed6fa%2Ffylr-openapi.yml?alt=media)
{% endopenapi %}

### `GET /oauth2/userinfo` — Get claims for the access-token user.

{% openapi src="/files/kfiDjhyZfEICNBmt5f49" path="/oauth2/userinfo" method="get" %}
[fylr-openapi.yml](https://4100607288-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAdRFzQASDY2Elfdm3wXW%2Fuploads%2Fgit-blob-27a76749464f8079ac8ce2ee65518544084ed6fa%2Ffylr-openapi.yml?alt=media)
{% endopenapi %}

### `POST /oauth2/userinfo` — Get claims for the access-token user (form POST).

{% openapi src="/files/kfiDjhyZfEICNBmt5f49" path="/oauth2/userinfo" method="post" %}
[fylr-openapi.yml](https://4100607288-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAdRFzQASDY2Elfdm3wXW%2Fuploads%2Fgit-blob-27a76749464f8079ac8ce2ee65518544084ed6fa%2Ffylr-openapi.yml?alt=media)
{% endopenapi %}
