@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”Validates the response shape for GET /.well-known/openid-configuration.
Remarks: Covers the minimum required fields of the OpenID Connect Discovery 1.0 specification (Section 3). response_types_supported is fixed to ['code'] (authorization code flow only). id_token_signing_alg_values_supported is fixed to ['RS256']. token_endpoint_auth_methods_supported is fixed to ['client_secret_post'].
function createOidcRouter(config: AuthResolvedConfig): voidSource: packages/slingshot-oidc/src/routes/oidc.ts