Skip to main content

OAuth 2.1 Authentication

FLTR uses OAuth 2.1 with PKCE (Proof Key for Code Exchange) to provide secure authentication for MCP clients like Claude Desktop, VS Code, Cursor, and web applications.

Overview

OAuth 2.1 provides:
  • 15,000 requests/hour rate limit (15x more than API keys)
  • Scope-based permissions for fine-grained access control
  • PKCE security to prevent authorization code interception
  • Automatic token refresh for seamless user experience
  • Native MCP support for AI development tools

Quick Start for MCP Clients

1

Configure Claude Desktop

Add FLTR to your Claude Desktop MCP configuration:
2

Authorize Access

  1. Restart Claude Desktop
  2. Click “Connect to FLTR” when prompted
  3. Log in and authorize the requested scopes
  4. Return to Claude Desktop - you’re connected!
3

Start Using FLTR

Query your datasets directly from Claude:

OAuth Flow

FLTR implements the Authorization Code flow with PKCE:

Implementation Guide

1. Register Your Application

  1. Log in to www.tryfltr.com
  2. Navigate to SettingsOAuth Applications
  3. Click Create OAuth App
  4. Fill in the details:
    • Name: Your application name
    • Redirect URI: Where users return after authorization
    • Scopes: Permissions your app needs
  5. Save your Client ID and Client Secret
Store your Client Secret securely. Never commit it to version control or expose it in client-side code.

2. Generate PKCE Parameters

Before starting the OAuth flow, generate PKCE parameters:

3. Authorization Request

Redirect the user to FLTR’s authorization endpoint:
Parameters: Available Scopes:

4. Handle Callback

After the user authorizes, FLTR redirects back to your redirect_uri with an authorization code:
Verify the state parameter matches what you sent to prevent CSRF attacks.

5. Exchange Code for Token

Exchange the authorization code for an access token:
Response:

6. Make API Requests

Use the access token to make authenticated API requests:

7. Refresh Tokens

Access tokens expire after 1 hour. Use the refresh token to get a new access token:

MCP Server Configuration

For MCP clients (Claude Desktop, VS Code, Cursor), use the FLTR MCP server:

Claude Desktop

~/Library/Application Support/Claude/claude_desktop_config.json (macOS) %APPDATA%\Claude\claude_desktop_config.json (Windows)

VS Code / Cursor

.vscode/settings.json or Cursor settings:

Security Best Practices

PKCE

Always use PKCE (code_challenge + code_verifier): Do:
  • Generate a cryptographically random code_verifier (43-128 characters)
  • Use SHA256 for code_challenge_method
  • Store code_verifier securely until token exchange
Don’t:
  • Skip PKCE (it’s required)
  • Reuse code_verifier across sessions
  • Use MD5 or other weak hashing

State Parameter

Use the state parameter to prevent CSRF:

Token Storage

Server-side applications:
  • Store tokens in encrypted database
  • Use HTTP-only cookies for refresh tokens
  • Never expose tokens to client-side JavaScript
Client-side applications:
  • Use secure storage (Keychain on macOS, Credential Manager on Windows)
  • Never store tokens in localStorage
  • Consider using httpOnly cookies with a token proxy

Redirect URI Validation

  • Register exact redirect URIs (no wildcards)
  • Use HTTPS in production (required)
  • Validate redirect_uri in both authorization and token requests

Error Handling

Authorization Errors

Common errors:
  • access_denied - User denied authorization
  • invalid_scope - Unknown or unauthorized scope
  • invalid_request - Missing required parameters
  • server_error - Temporary server issue

Token Errors

Common errors:
  • invalid_grant - Expired or invalid authorization code
  • invalid_client - Invalid client credentials
  • unauthorized_client - Client not authorized for this grant type
Handle token refresh failures:

Complete Example

Here’s a complete Flask application with OAuth:

Next Steps

MCP Query Endpoint

Use OAuth tokens to query datasets

Scopes Reference

Understand OAuth scope permissions

Rate Limits

OAuth rate limit details

Security Guide

OAuth security best practices