UNPKG

@simulacrum/auth0-simulator

Version:

Run local instance of Auth0 API for local development and integration testing

33 lines (31 loc) 816 B
import { JWKS } from "../auth/constants.mjs"; import { removeTrailingSlash } from "./url.mjs"; //#region src/handlers/openid-handlers.ts const createOpenIdHandlers = (serviceURL) => { return { ["/.well-known/jwks.json"]: function(_, res) { res.status(200).json(JWKS); }, ["/.well-known/openid-configuration"]: function(req, res) { let url = removeTrailingSlash(serviceURL(req)); res.status(200).json({ issuer: `${url}/`, authorization_endpoint: [url, "authorize"].join("/"), token_endpoint: [ url, "oauth", "token" ].join("/"), userinfo_endpoint: [url, "userinfo"].join("/"), jwks_uri: [ url, ".well-known", "jwks.json" ].join("/") }); } }; }; //#endregion export { createOpenIdHandlers }; //# sourceMappingURL=openid-handlers.mjs.map