---
title: "Complete login/consent for an authorization request"
method: POST
path: "/oauth2/login"
tags: ["authentication"]
---

# Complete login/consent for an authorization request

`POST /oauth2/login`

Called by the consent UI after user authenticates and consents. Sets the user on the auth request and redirects back to the client with an authorization code.

## Request body

- OAuth2LoginRequest
  - `requestId` string, uuid, required

## Response `200`

Authorization completed, redirect URL returned

- OAuth2LoginCompleteResponse
  - `redirectUri` string, uri, required

## Other responses

- `default` — An error occurred

## Changes

- **2026-06-24** `0fc5fd589dbf` — 1 warning
  - added the new `otp-too-many-attempts` enum value to the `error` response property for the response status `default`
- **2026-04-20** `b39086c84b43` — 1 warning, 1 info
  - added the new `user-already-exists` enum value to the `error` response property for the response status `default`
  - removed the `email-already-in-use` enum value from the `error` response property for the response status `default`
- **2026-02-19** `50e643cc3991` — 1 info
  - endpoint added
- **2025-10-09** `2bb5c4e40463` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/nhost/apis/nhost-authentication-api/changes/oauth2/login/post.md)

---

[API](https://skmtc.dev/nhost/apis/nhost-authentication-api.md) · [All operations](https://skmtc.dev/nhost/apis/nhost-authentication-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/nhost/nhost-authentication-api/revisions/0fc5fd589dbf/schema)
