---
title: "Authenticate a user with OpenID Connect"
method: POST
path: "/auth/openid/{provider}/callback"
tags: ["auth"]
---

# Authenticate a user with OpenID Connect

`POST /auth/openid/{provider}/callback`

After a redirect from the OpenID Connect provider to the frontend has been made with the authentication `code`, this endpoint can be used to obtain a jwt token for that user and thus log them in.

## Path parameters

- `provider` integer, required

## Request body

- OpenidCallback
  - `code` string
  - `redirect_url` string
  - `scope` string
  - `totp_passcode` string — TOTPPasscode is required when the resolved user has TOTP enabled. Clients must restart the OIDC flow and populate this field after receiving a 412 with error code 1017. See GHSA-8jvc-mcx6-r4cg.

## Response `200`

OK

- AuthToken
  - `token` string

## Other responses

- `412` — Invalid totp passcode.
- `500` — Internal error

---

[API](https://skmtc.net/go-vikunja/apis/vikunja-api.md) · [All operations](https://skmtc.net/go-vikunja/apis/vikunja-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/go-vikunja/vikunja-api/revisions/feb3f68bbdf1/schema)
