Skip to content
Talk to an Engineer Dashboard

Coding agents: Add SSO to your app

Let your coding agents guide you into adding Scalekit SSO to your existing application in minutes

Use AI coding agents like Claude Code, GitHub Copilot CLI, Cursor, and OpenCode to add Scalekit’s Modular SSO to your existing applications. This guide shows you how to configure these agents so they analyze your codebase, apply SSO patterns, and generate production-ready code that integrates enterprise identity providers and follows security best practices while reducing implementation time from hours to minutes.

  1. Add the Scalekit Auth Stack marketplace

    Not yet on Claude Code? Follow the official quickstart guide to install it.

    Register Scalekit’s plugin marketplace to access pre-configured authentication skills. This marketplace provides context-aware prompts and implementation guides that help coding agents generate correct Modular SSO code.

    Start the Claude Code REPL:

    Terminal
    claude

    Then add the marketplace:

    Claude REPL
    /plugin marketplace add scalekit-inc/claude-code-authstack

    When the marketplace registers successfully, you’ll see confirmation output:

    Terminal
    /plugin marketplace add scalekit-inc/claude-code-authstack
    Successfully added marketplace: scalekit-auth-stack

    The marketplace provides specialized authentication plugins that understand SSO patterns and SAML/OIDC security requirements. These plugins guide the coding agent to generate implementation code that matches your project structure.

    To remove the Scalekit Auth Stack marketplace, use the uninstall command:

    Claude REPL
    /plugin marketplace remove scalekit-auth-stack
  2. Enable authentication plugins

    Select which authentication capabilities to activate in your development environment. Each plugin provides specific skills that the coding agent uses to generate SSO code.

    Directly install the specific plugin:

    Claude REPL
    /plugin install modular-sso@scalekit-auth-stack
    Alternative: Enable authentication plugins via plugin wizard

    Run the plugin wizard to browse and enable available plugins:

    Claude REPL
    /plugins

    Navigate through the visual interface to enable the Modular SSO plugin.

  3. Generate SSO implementation

    Use a structured prompt to direct the coding agent. A well-formed prompt ensures the agent generates complete, production-ready SSO code that includes all required security components.

    Copy the following prompt into your coding agent:

    SSO implementation prompt
    Guide the coding agent to add Scalekit SSO to my existing app — initialize ScalekitClient, generate an SSO authorization URL for a given organization, handle the SSO callback to validate and exchange the code for user identity, and integrate the SSO user into my existing session system. Code only.

    When you submit this prompt, Claude Code loads the Modular SSO skill from the marketplace -> analyzes your existing application structure -> generates Scalekit client initialization with environment credentials -> creates an SSO authorization URL generator for organization-based routing -> implements the SSO callback handler to validate and exchange the code for user identity -> integrates SSO user data into your existing session system.

  4. Verify the implementation

    After the coding agent completes, verify that all SSO components are properly configured:

    Check generated files:

    • Scalekit client initialization with environment credentials (you may need to set up a .env file with your Scalekit API credentials)
    • SSO authorization URL generation for organization-based routing
    • SSO callback handler that validates the authorization code and retrieves user identity
    • Integration logic that maps SSO user identity into your existing session system

    The SSO flow should redirect users to their organization’s identity provider, where they authenticate. Your application should then receive the callback, validate the code, extract the user’s identity, and create or update the user session accordingly.

When users authenticate through SSO, your application receives verified identity claims from the identity provider. Verify that the SSO callback correctly maps user identity to your application’s user model and that the session is created with the appropriate access level.