<!-- https://testapilocally.com/docs/core-features/authentication/ -->
# Authentication

* **Platform Availability:** Windows App · VS Code Extension (shared shell)
* **Overview:** Configure auth per request or inherit from folder/collection. OAuth local callback, AWS SigV4, and Hawk are supported; NTLM appears in the UI but is not supported yet.

![Windows - Auth editor](/docs/assets/screenshots/windows/windows-auth-editor.png)

## Supported types

| Type | Notes |
|------|-------|
| none | No auth headers |
| inherit | Use parent folder/collection auth |
| bearer | `Authorization: Bearer …` |
| basic | Username / password |
| api-key | Header or query placement |
| oauth2 | authorization_code (+ PKCE), client_credentials, refresh_token, password, implicit |
| oauth1 | Consumer key/secret + token |
| digest | Digest challenge flow |
| aws-signature | AWS SigV4 signing |
| hawk | Hawk auth |
| ntlm | **Not supported yet** (gap) |
| custom | Custom header injection |

## How It Works (Windows App)

1. Open a request → **Auth** tab (or set collection/folder Authorization).
2. Choose type and fill fields.
3. For OAuth2 authorization code, SignOff Studio can start a local callback listener via the desktop host.
4. Send the request; inspect response Auth-related headers as needed.

## How It Works (VS Code Extension)

1. Same Auth tab in the webview.
2. OAuth local callback is handled by the VS Code host (`oauth-local-callback`).

![VS Code - Auth](/docs/assets/screenshots/vscode/vscode-auth-editor.png)

## Code / Configuration Examples

Bearer:

```http
Authorization: Bearer {{token}}
```

API key header:

```http
X-API-Key: {{apiKey}}
```

OAuth2 client credentials (fields in UI):

```json
{
  "type": "oauth2",
  "grantType": "client_credentials",
  "accessTokenUrl": "https://auth.example.com/oauth/token",
  "clientId": "{{clientId}}",
  "clientSecret": "{{clientSecret}}",
  "scope": "api.read"
}
```

## Edge Cases, Troubleshooting & Pro-Tips

- Prefer **inherit** at collection level for microservice suites.
- Store tokens in environment **Secrets**, not plain Variables.
- PKCE is recommended for public clients using authorization_code.

> **GAP IDENTIFIED:** NTLM is listed in the auth type picker but is not implemented. Use an external gateway or Basic/Bearer where possible. Marketplace copy also states NTLM is not supported yet.

## Next

- [Requests](/docs/core-features/requests/)
- [Environments](/docs/core-features/environments/)
