---
title: Authentication Guide
description: A complete guide to authentication features including OAuth, magic links, and MFA.
date: "2025-01-20"
author: Team
---

Your application comes with a full authentication system built into its API server.

## Supported Methods

- **Email & Password**: traditional sign-up and sign-in
- **OAuth Providers**: Google, Microsoft
- **Magic Links**: passwordless sign-in via email
- **Multi-Factor Authentication**: TOTP-based MFA for added security

## Enabling OAuth Providers

Google and Microsoft sign-in run inside your app, so there is no separate auth dashboard. Run `vibecarbon configure` and pick **OAuth**: it writes the provider's switch and credentials to your environment, and `vibecarbon deploy` ships them to your server:

```bash
GOOGLE_ENABLED=true
GOOGLE_CLIENT_ID=...
GOOGLE_CLIENT_SECRET=...
MICROSOFT_ENABLED=true
MAGIC_LINK_ENABLED=true
```

In the provider's console, set the redirect URI to `<SITE_URL>/api/auth/callback/google` (or `/microsoft`). The sign-in page shows a button for each provider you enable.

## Row-Level Security

All database access is secured with Row-Level Security (RLS) policies. Users can only access data they're authorized to see, enforced at the database level.
