๐ OAuth Blocks
OAuth blocks provide the primitives to integrate third-party OAuth providers into NodeBlocks services. Providers currently supported: Google and Twitter. The design allows for expansion to other providers.
๐ฆ Block Typesโ
๐ Schemasโ
JSON Schema/OpenAPI definitions used to validate and describe OAuth-related endpoints.
- fpQueryParameter: Fingerprint tracking parameter
- purposeQueryParameter: Flow purpose (
oauth-login
|oauth-signup
) - redirectUrlQueryParameter: Client redirect URL after OAuth
- typeIdQueryParameter: Optional identity type identifier
- stateQueryParameter: OAuth callback state verifier
- googleOauthSchema: OAuth initiation schema (query-only, empty body)
- twitterOauthSchema: OAuth initiation schema (query-only, empty body)
๐ Featuresโ
Composed features that combine schemas, routes, and blocks for end-to-end OAuth flows.
- googleOAuthFeature: OAuth initiation workflow
- googleOAuthCallbackFeature: OAuth callback processing and redirect
- twitterOAuthFeature: OAuth initiation workflow
- twitterOAuthCallbackFeature: OAuth callback processing and redirect
๐ฃ๏ธ Routesโ
HTTP endpoint definitions for OAuth initiation and callbacks.
- googleOAuthRoute: GET
/auth/oauth/google
โ Initiate Google OAuth - googleOAuthCallbackRoute: GET
/auth/oauth/google/callback
โ Handle callback and redirect - twitterOAuthRoute: GET
/auth/oauth/twitter
โ Initiate Twitter OAuth - twitterOAuthCallbackRoute: GET
/auth/oauth/twitter/callback
โ Handle callback and redirect
โ๏ธ Blocksโ
Pure business logic functions for OAuth flow orchestration.
- requestGoogleOAuth: Initiate provider flow with signed state
- authenticateGoogleOAuth: Authenticate provider callback and read profile
- extractOAuthLoginState: Decode and validate OAuth state token
- verifyGoogleOAuth: Map provider profile to identity; create or resolve
- generateRedirectURL: Build redirect URL with onetime/access token
- prepareTwitterCallbackState: Build state object for Twitter callback
- requestTwitterOAuth: Initiate Twitter authentication request
- authenticateTwitterOAuth: Authenticate Twitter callback
- verifyTwitterOAuth: Map Twitter profile to identity; create or resolve