Skip to main content
Version: 🚧 Canary

🚀 OAuth features

OAuth features are SDK composers, not Express middleware; authService mounts each provider's initiation and callback feature.

All three callback features require a nonempty configuration.oauth.allowedRedirectOrigins allowlist. Their routes validate the state's redirect URL after provider callback/state processing and before identity checks, token generation, storage, or redirect: malformed/disallowed URLs return 400, and undefined/empty origins return 500. This is handler validation; the callback features still compose no schema or route validators. See callback routes for the full pipelines.

All three initiation features also validate the request's redirectUrl before provider state preparation or driver invocation. Malformed/disallowed URLs map to 400; missing/empty origins return AuthenticationUnexpectedError mapped to 500 by the initiation route. Initiation schemas still validate parameter shape separately from this handler check.

Inventory​

FeatureComposed schema(s)Composed route(s)Purpose
googleOAuthFeaturegoogleOauthSchemagoogleOAuthRouteStart Google OAuth.
googleOAuthCallbackFeaturenonegoogleOAuthCallbackRouteHandle Google callback.
lineOAuthFeaturelineOauthSchemalineOAuthRouteStart LINE OAuth.
lineOAuthCallbackFeaturenonelineOAuthCallbackRouteHandle LINE callback.
twitterOAuthFeaturetwitterOauthSchematwitterOAuthRouteStart Twitter OAuth.
twitterOAuthCallbackFeaturenonetwitterOAuthCallbackRouteHandle Twitter callback.

Details​

Each feature is mounted by authService. The source definitions below show the exact schema-to-route composition.

googleOAuthFeature​

Implementation

This feature composes the schema and route linked in its inventory row; it is mounted by authService or a compatible custom service context.

View complete source
export const googleOAuthFeature = compose(googleOauthSchema, googleOAuthRoute);

googleOAuthCallbackFeature​

Implementation

This feature composes the schema and route linked in its inventory row; it is mounted by authService or a compatible custom service context.

Composes only the callback route; no callback schema is composed.

View complete source
export const googleOAuthCallbackFeature = compose(googleOAuthCallbackRoute);

lineOAuthFeature​

Implementation

This feature composes the schema and route linked in its inventory row; it is mounted by authService or a compatible custom service context.

View complete source
export const lineOAuthFeature = compose(lineOauthSchema, lineOAuthRoute);

lineOAuthCallbackFeature​

Implementation

This feature composes the schema and route linked in its inventory row; it is mounted by authService or a compatible custom service context.

Composes only the callback route; no callback schema is composed.

View complete source
export const lineOAuthCallbackFeature = compose(lineOAuthCallbackRoute);

twitterOAuthFeature​

Implementation

This feature composes the schema and route linked in its inventory row; it is mounted by authService or a compatible custom service context.

View complete source
export const twitterOAuthFeature = compose(twitterOauthSchema, twitterOAuthRoute);

twitterOAuthCallbackFeature​

Implementation

This feature composes the schema and route linked in its inventory row; it is mounted by authService or a compatible custom service context.

Composes only the callback route; no callback schema is composed.

View complete source
export const twitterOAuthCallbackFeature = compose(twitterOAuthCallbackRoute);