Our Philosophy: Secure by Design
Jean Memory handles sensitive personal data, and we take that responsibility seriously. That’s why we’ve built our authentication system on the industry-standard OAuth 2.1 protocol. This ensures that user credentials are never shared with third-party applications and that users have full control over who can access their memory.Two-Layer Security Architecture
Jean Memory uses a dual authentication system for maximum security:Layer 1: Application Authentication
- API Key: Each application gets a unique API key (
jean_sk_...
) - Purpose: Identifies and authorizes your application to use Jean Memory
- Scope: Application-level permissions and billing
Layer 2: User Authentication
- JWT Token: Each user gets a unique JWT token per session
- Purpose: Identifies the specific user and their memories
- Scope: User-specific data access and privacy
How They Work Together:
Flow 1: Browser-Based Apps (PKCE Grant)
This flow is designed for frontend applications (e.g., React, Vue, Svelte) running in a user’s browser. It uses the Proof Key for Code Exchange (PKCE) grant type, which is the current best practice for securing public clients.Universal Identity System
Jean Memory now features a universal identity system that ensures users maintain the same identity across all applications and sessions. When a user signs in with their email (via Google, GitHub, or email auth), they are mapped to a single, permanent user ID. This means:- Consistent Identity: Users keep the same memories across different apps using Jean Memory
- Provider Flexibility: Users can sign in with any supported provider and access the same account
- Cross-Platform: The same user account works on web, mobile, and desktop applications
The Easy Way: 5 Lines of Code
For React developers, we’ve made this incredibly simple. Our SDK handles the entire OAuth 2.1 PKCE flow automatically, including session persistence and user identity management.- OAuth 2.1 PKCE Flow: Secure authentication with Google (no client secrets needed)
- Session Persistence: Users stay logged in across browser refreshes and tabs
- Universal Identity: Same user account across all Jean Memory applications
- Automatic API Requests: All memory queries include user context automatically
- Error Recovery: Handles token expiration and network issues gracefully
Flow 2: Backend Services (Authorization Code Grant)
This flow is for trusted backend services that need to access a user’s memory on their behalf, even when the user is not actively present (e.g., for a background data sync). It uses the standard Authorization Code Grant. This is a more involved flow that requires server-side handling of secrets.High-Level Steps
- User Authorization: Your application redirects the user to the Jean Memory authorization URL with your
client_id
and aredirect_uri
. - Grant Authorization Code: The user logs in and approves the request. Jean Memory redirects back to your
redirect_uri
with a temporarycode
. - Exchange Code for Token: Your backend service makes a secure, server-to-server request to the Jean Memory token endpoint, exchanging the
code
(along with yourclient_id
andclient_secret
) for anaccess_token
and arefresh_token
. - Access API: Your service can now use the
access_token
to make authenticated requests to the Jean Memory API on the user’s behalf. - Refresh Token: When the
access_token
expires, use therefresh_token
to obtain a new one without requiring the user to log in again.
Getting Credentials: The server-to-server flow is intended for trusted partners and high-volume applications. Please contact our team to discuss your use case and receive a
client_id
and client_secret
.Live Demo
Want to see the OAuth 2.1 PKCE flow in action? Check out our Jean Authentication Demo Repository - a complete React application that demonstrates the 5-line integration promise. View Live Demo Repository → This demo shows:- Complete OAuth 2.1 PKCE authentication flow
- Persistent user sessions with localStorage
- Real-time AI chat with memory persistence
- Universal identity across Jean Memory applications
- Production-ready implementation with comprehensive documentation