Reference

SP Configuration

Complete configuration reference for @openape/nuxt-auth-sp.

SP Configuration

All configuration options for the @openape/nuxt-auth-sp Nuxt module.

Module Options

Configure in nuxt.config.ts under the openapeSp key:

export default defineNuxtConfig({
  modules: ['@openape/nuxt-auth-sp'],
  openapeSp: {
    clientId: 'app.example.com',
    sessionSecret: process.env.SP_SESSION_SECRET,
    fallbackIdpUrl: 'https://id.openape.at'
  }
})

Core Options

OptionTypeDefaultEnv VarDescription
clientIdstring''NUXT_OPENAPE_SP_CLIENT_IDOIDC client ID (auto-derived to localhost:PORT in dev)
spNamestring'OpenApe Service Provider'NUXT_OPENAPE_SP_SP_NAMEService provider display name
sessionSecretstring'change-me-...'NUXT_OPENAPE_SP_SESSION_SECRETSession encryption secret (auto-generated in dev, required in prod)
openapeUrlstring''NUXT_OPENAPE_SP_OPENAPE_URLOpenApe IdP URL (overrides DNS discovery)
fallbackIdpUrlstring'https://id.openape.at'NUXT_OPENAPE_SP_FALLBACK_IDP_URLFallback IdP when no DDISA TXT record exists
routesbooleantrueEnable route handlers

Server Routes

When routes: true (default), these routes are auto-registered:

MethodPathDescription
POST/api/loginInitiate login (accepts { email }, returns redirect URL)
GET/api/callbackOAuth callback (exchanges code for token, creates session)
POST/api/logoutEnd session
GET/api/meGet current user info
GET/.well-known/oauth-client-metadataOAuth client metadata
GET/.well-known/auth.mdMachine-readable auth spec for agents
GET/.well-known/openape.jsonOpenApe service manifest

Client-Side API

useOpenApeAuth() Composable

const { user, loading, fetchUser, login, logout } = useOpenApeAuth()
PropertyTypeDescription
userRef<User | null>Current user (null if not logged in)
loadingRef<boolean>Loading state
fetchUser()() => Promise<void>Refresh user data from /api/me
login(email)(email: string) => Promise<void>Start login flow
logout()() => Promise<void>End session

<OpenApeAuth /> Component

Drop-in login form:

<OpenApeAuth
  title="Login"
  subtitle="Enter your email"
  button-text="Continue"
  placeholder="you@example.com"
  @error="handleError"
/>

Props:

PropTypeDefaultDescription
titlestring'Login'Form title
subtitlestring'Enter your email to sign in'Form subtitle
buttonTextstring'Continue'Submit button text
placeholderstring'you@example.com'Email input placeholder

Events:

EventPayloadDescription
errorErrorEmitted when login fails

Slots: header, button, error, footer

CSS Variables:

VariableDefaultDescription
--oa-bgBackground color
--oa-borderBorder color
--oa-textText color
--oa-primaryPrimary/accent color
--oa-errorError text color
--oa-radiusBorder radius
--oa-fontFont family

Service Manifest

The manifest option configures the /.well-known/openape.json endpoint, which agents use to discover the SP's capabilities:

openapeSp: {
  manifest: {
    service: {
      name: 'My App',
      description: 'A grant-aware application',
      url: 'https://app.example.com',
      contact: 'admin@example.com'
    },
    auth: {
      ddisa_domain: 'example.com',
      supported_methods: ['ddisa']
    },
    scopes: {
      'read:data': {
        name: 'Read Data',
        description: 'Read application data',
        risk: 'low'
      },
      'write:data': {
        name: 'Write Data',
        description: 'Modify application data',
        risk: 'medium'
      }
    },
    policies: {
      agent_access: 'grant_required',
      delegation: 'allowed'
    }
  }
}

Vercel / Serverless Deployment

For serverless environments, configure Nitro to inline external dependencies:

export default defineNuxtConfig({
  nitro: {
    preset: 'vercel',
    externals: {
      inline: ['@openape/nuxt-auth-sp']
    }
  }
})

Production Checklist

  • Set a strong sessionSecret (32+ random characters)
  • Set clientId to your production domain
  • Configure fallbackIdpUrl (or set to '' to reject domains without DDISA records)
  • Ensure your app is served over HTTPS
  • Configure the service manifest for agent discoverability