Menu
Libraries |
Category

sveltekit-oidc

  • Purpose: Integrates OpenID confidential flow with SvelteKit, handling authentication workflows with Keycloak (or other OpenID providers).
  • Key Features:
    • Silent refresh workflow
    • Validates and renews access tokens
    • Offline auth server error handling
    • Manages user session data (tokens, user info) via cookies
    • Synchronizes logout/login across browser tabs
    • Follows JWT best practices from Hasura Blog on JWT Auth
  • Target Audience: SvelteKit developers needing OpenID Connect (OIDC) integration.
  • SvelteKit Support: Designed specifically for SvelteKit applications.
  • Core Components:
    • <Keycloak> wrapper for OIDC configuration
    • <KeycloakProtectedRoute> for guarding routes
    • Stores (isAuthenticated, accessToken, etc.) for auth state
    • <LoginButton> and <LogoutButton> components
  • Configuration: Requires environment variables for OIDC issuer, client details, and endpoints.
  • Workflow: Handles server-side token exchange and client-side session management.

sveltesveltekitkeycloakopenid-connectssrtailwindcssauthenticationauthsveltekit-oidc

Comments