---
title: "Aas Oauth Callback"
method: GET
path: "/api/aas/oauth/callback"
tags: ["Connections"]
---

# Aas Oauth Callback

`GET /api/aas/oauth/callback`

## Request

- Base URL: `https://app.getdot.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://app.getdot.ai/api/aas/oauth/callback`
- Auth: none declared

Handle AAS OAuth callback from Microsoft with automatic tenant discovery.

This endpoint:
1. Validates state parameter (CSRF protection)
2. Exchanges authorization code for tokens
3. Extracts tenant_id from token claims
4. Stores refresh token in database (encrypted)
5. Tests connection by listing databases on the AAS server
6. Returns HTML that closes popup and notifies parent window

## Query parameters

- `code` string
- `state` string
- `error` string
- `error_description` string

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/getdot/apis/dot-api-2.md) · [All operations](https://skmtc.dev/getdot/apis/dot-api-2/llms.txt) · [OpenAPI document](https://skmtc.dev/getdot/apis/dot-api-2/revisions/d26fe7163a7f?raw)
