Skip to main content
Version: 🚧 Canary

🔗 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)

View OAuth Schema Blocks →

🚀 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

View OAuth Feature Blocks →

🛣️ 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

View OAuth Route Blocks →

⚙️ 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

View OAuth Blocks →


📚 Navigation