@lastshotlabs/slingshot-oidc
npm install @lastshotlabs/slingshot-oidc
Functions
Section titled “Functions”createOidcPlugin
Section titled “createOidcPlugin”Creates the Slingshot OIDC discovery and JWKS plugin.
Mounts two well-known endpoints on the application:
GET /.well-known/openid-configuration— OIDC discovery documentGET /.well-known/jwks.json— JSON Web Key Set (public keys)
Requires slingshot-auth to be registered as a dependency and
auth.oidc to be set in the auth plugin config with a loaded signing key.
Remarks: Use loadJwksKey / generateAndLoadKeyPair from the jwks module to attach RS256 signing keys to the OIDC config before starting the server. The plugin now fails closed when OIDC is enabled without a signing key, rather than publishing discovery metadata with an empty JWKS.
function createOidcPlugin(): SlingshotPluginSource: packages/slingshot-oidc/src/plugin.ts
createOidcRouter
Section titled “createOidcRouter”Creates the Hono router that serves the OIDC discovery document and JWKS.
Mounts:
GET /.well-known/openid-configuration— standard OIDC discovery document containing issuer, endpoints, supported algorithms, and scopes.GET /.well-known/jwks.json— JSON Web Key Set with the RS256 public keys used to verify tokens issued by this server.
Remarks: This function is called internally by createOidcPlugin. Call it directly only when composing a custom plugin.
function createOidcRouter(config: AuthResolvedConfig): voidSource: packages/slingshot-oidc/src/routes/oidc.ts