Skip to content

Overview

Greg Bowler edited this page Nov 1, 2026 · 2 revisions

When someone visits our application, there are two sessions: the application's session and the provider's session. The TypeScript client reads and writes the application's session. The provider handles its own screens and session.

Following a login

Construct Authenticator early in each request, before sending output. Ordinary requests restore the user from session data.

login() creates a token, stores it and redirects to the provider with an encrypted message and the deployment ID from the client key. The return destination defaults to the current request URI. Call setReturnUri() before login to choose another route. The provider validates it against the configured client origin.

After authentication the provider returns an AUTHWAVE_RESPONSE_DATA query parameter. Construction decrypts it using the stored token and secret, stores the user, invokes onAuthenticated when supplied, and redirects to remove the response parameter while restoring the saved query string.

The next request restores the user. Application code does not need to decrypt the response.

The objects we work with

Authenticator provides login(), logout(), isLoggedIn() and getAuthUser(). AuthUser is a read-only snapshot of ID and email, not a live provider connection.

SessionData, Token and provider URI classes support the exchange. The runtime adapters supply request-scoped sessions and catch redirect signals. See Sessions and redirects and API reference.

The provider and the application

Register a deployment and use its complete client key. Each environment needs matching provider configuration and return locations. Keep keys on the server. This package is for Node.js servers, including Express and Next.js's Node.js runtime; do not bundle it into browser components.

The provider authenticates visitors. Our application associates identities with local records and enforces permissions.


Next, follow the Quick start guide.

Clone this wiki locally