# Auth

## Get Authentication Info

**get** `/auth/info`

Returns the authenticated caller's identity.The response shape depends on the credential type: `apiKey` for PAT
callers, `oauth` for OAuth user callers. Exactly one of `apiKey` or `oauth` is populated;
`type` discriminates.

### Returns

- `type: "apiKey" or "oauth"`

  Discriminator for the credential shape. `apiKey` for PAT callers; `oauth` for OAuth
  user callers.

  - `"apiKey"`

  - `"oauth"`

- `apiKey: optional object { created, issuing_user, name, 2 more }`

  Information about the API key credentials (PAT)

  - `created: string`

    When the client credentials were created

  - `issuing_user: object { id, email, name }`

    Information about the user who created the credentials

    - `id: string`

      The user ID

    - `email: string`

      The user's email

    - `name: string`

      The user's name

  - `name: string`

    The name of the credential

  - `project: object { id, name, plan_type }`

    Information about the project

    - `id: string`

      The project ID

    - `name: string`

      The name of the project

    - `plan_type: string`

      The plan type for the project

  - `public_key: string`

    The public key of the client credentials

- `oauth: optional object { user }`

  OAuth user details. Present for OAuth user callers.

  - `user: object { id, email, name }`

    - `id: string`

      The numeric user ID

    - `email: string`

      The user's email

    - `name: string`

      The user's name

### Example

```http
curl https://console.cloud.tigerdata.com/public/api/v1/auth/info \
    -H "Authorization: Bearer $TIGER_CLOUD_API_KEY"
```

#### Response

```json
{
  "type": "apiKey",
  "apiKey": {
    "created": "2024-01-15T10:30:00Z",
    "issuing_user": {
      "id": "user123",
      "email": "john.doe@example.com",
      "name": "John Doe"
    },
    "name": "my-production-token",
    "project": {
      "id": "rp1pz7uyae",
      "name": "My Production Project",
      "plan_type": "FREE"
    },
    "public_key": "tskey_abc123"
  },
  "oauth": {
    "user": {
      "id": "1234567",
      "email": "john.doe@example.com",
      "name": "John Doe"
    }
  }
}
```

## Domain Types

### Auth Retrieve Info Response

- `AuthRetrieveInfoResponse object { type, apiKey, oauth }`

  Information about the authentication credentials being used. Exactly one
  of `apiKey` or `oauth` is populated; the `type` field discriminates.

  - `type: "apiKey" or "oauth"`

    Discriminator for the credential shape. `apiKey` for PAT callers; `oauth` for OAuth
    user callers.

    - `"apiKey"`

    - `"oauth"`

  - `apiKey: optional object { created, issuing_user, name, 2 more }`

    Information about the API key credentials (PAT)

    - `created: string`

      When the client credentials were created

    - `issuing_user: object { id, email, name }`

      Information about the user who created the credentials

      - `id: string`

        The user ID

      - `email: string`

        The user's email

      - `name: string`

        The user's name

    - `name: string`

      The name of the credential

    - `project: object { id, name, plan_type }`

      Information about the project

      - `id: string`

        The project ID

      - `name: string`

        The name of the project

      - `plan_type: string`

        The plan type for the project

    - `public_key: string`

      The public key of the client credentials

  - `oauth: optional object { user }`

    OAuth user details. Present for OAuth user callers.

    - `user: object { id, email, name }`

      - `id: string`

        The numeric user ID

      - `email: string`

        The user's email

      - `name: string`

        The user's name
