---
title: "Login"
method: GET
path: "/login"
tags: ["Authentication"]
---

# Login

`GET /login`

OAuth2 login endpoint. Initiates the OAuth2 authorization code flow.
    
    **Query Parameters:**
    - `redirect_uri`: The URI to redirect to after authentication (required)
    - `state`: A random string for CSRF protection (optional but recommended)
    
    **Flow:**
    1. Client redirects user to this endpoint with `redirect_uri` and `state`
    2. This endpoint redirects user to Auth0 for authentication
    3. After authentication, Auth0 redirects to `/callback` with authorization code
    4. `/callback` redirects back to the original `redirect_uri` with code and state
    
    **Example:**
    ```
    GET /login?redirect_uri=https://chat.openai.com&state=abc123
    ```

## Response `200`

OAuth2 login initiated successfully

- LoginResponse — Response model for OAuth2 login endpoint
  - `message` string
  - `redirect_url` string, nullable

## Other responses

- `400` — Bad request - missing redirect URI
- `500` — Internal server error

---

[API](https://skmtc.net/papr-ai/apis/papr-memory-api.md) · [All operations](https://skmtc.net/papr-ai/apis/papr-memory-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/papr-ai/papr-memory-api/versions/b553be9aad37/schema)
