# Auth API

Login, logout, refresh tokens, and user registration

## Endpoints

### POST    /auth/login    Authenticate user        URL    cURL

### POST    /auth/logout    End user session        URL    cURL

### POST    /auth/refresh    Refresh access token        URL    cURL

### POST    /auth/register    Create new account        URL    cURL

## Authentication Patterns

### 🔑JWT Tokens

JSON Web Tokens for stateless authentication

### 🍪Session Cookies

HTTP-only cookies for secure session management

### 🔄Refresh Tokens

Long-lived tokens to obtain new access tokens

### 🛡️OAuth 2.0

Third-party authentication with Google, GitHub, etc.

## Common Use Cases

### Login Forms

User authentication with email/password

### Registration

New user signup with validation

### Protected Routes

Restrict access to authenticated users

### Token Expiry

Handle token refresh and expiration

### Try it with MockAPI Dog

Create a mock Auth API endpoint in seconds – no signup required!

[Create Auth Endpoint](/content/en/index.html)
