alfadocs-connected-app-oauth

Implement AlfaDocs OAuth2 PKCE login via a Supabase Edge Function.

Updated Mar 9, 2026
One-click install
npx skills add https://github.com/alfadocs/ai-harness-instructions --skill alfadocs-connected-app-oauth
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: alfadocs-connected-app-oauth
Source: https://github.com/alfadocs/ai-harness-instructions/tree/main/lovable/skills/alfadocs-connected-app-oauth
Command: npx skills add https://github.com/alfadocs/ai-harness-instructions --skill alfadocs-connected-app-oauth

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill removes the complexity of building secure AlfaDocs sign-in for connected and marketplace apps, where each practice authenticates with its own account instead of using a shared API key.

Core Features & Use Cases

  • OAuth2 + PKCE Login Flow: Handles the full AlfaDocs authorization flow through a single Supabase Edge Function, keeping client secrets and access tokens off the browser.
  • Server-Side Session Management: Stores tokens behind an HttpOnly session cookie, supports session checks and logout, and avoids unsafe local storage patterns.
  • Production App Integration: Guides React routing, protected pages, redirect URI matching, scope selection, token refresh, and API proxying for real-world marketplace apps.
  • Use Case: Build a Lovable app that lets multiple AlfaDocs practices sign in individually, then securely fetch practice-specific data from server-side functions.

Quick Start

Use this Skill to implement secure AlfaDocs sign-in for a Lovable app with a single Supabase Edge Function, exact redirect configuration, and server-side session handling.

Frequently Asked Questions about alfadocs-connected-app-oauth

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement secure OAuth2 login with PKCE in a Lovable app using Supabase Edge Functions?

Secure OAuth2 login with PKCE in a Lovable app is implemented through a single Supabase Edge Function backend-for-frontend that keeps client secrets and access tokens entirely server-side.

How does server-side session management keep AlfaDocs access tokens off the browser?

Server-side session management stores AlfaDocs access tokens behind an HttpOnly session cookie, supporting session checks and logout while avoiding unsafe browser local storage patterns.

Do I need a backend-for-frontend to handle AlfaDocs marketplace app authentication for multiple practices?

Yes, marketplace apps where each practice signs in with its own AlfaDocs account require a single Supabase Edge Function BFF to handle OAuth2 PKCE, exact redirect matching, and scoped API access.

What's the best way to protect React routes and proxy API calls for an AlfaDocs connected app?

The best way to protect React routes and proxy API calls is by guiding React routing and protected pages through server-side functions that manage token refresh and scoped API access.

Why does my AlfaDocs OAuth redirect fail when building a connected app in Lovable?

AlfaDocs OAuth redirects require exact redirect URI matching configured within the Supabase Edge Function, ensuring the browser never receives tokens or secrets during the authorization flow.