Replies: 1 comment
-
|
The The If you actually need access to the authorization server metadata inside the hook, you would need to either:
app.use("/*", async (c, next) => {
const oidcAuth = oidcAuthMiddleware({
oidcClaimsHook: async (orig, claims, response) => {
// Access c here via closure
const server = c.get("oidcAuthorizationServer");
const userInfo = await fetch(server.userinfo_endpoint, {
headers: { Authorization: `Bearer ${response.access_token}` },
}).then((res) => res.json());
return { ...orig, ...userInfo };
},
});
return oidcAuth(c, next);
});
Worth opening an issue or PR to fix that README snippet — it is misleading as-is. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
In the README of
oidc-auth, under the section "Using original response or additional claims", there is the following code:However, I can't find where
cis defined or how it should be resolved in this context.Am I missing something?
Beta Was this translation helpful? Give feedback.
All reactions