-
Notifications
You must be signed in to change notification settings - Fork 0
add grant-type assertions for jwt-bearer #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: defang
Are you sure you want to change the base?
Conversation
…rant-type' into add-jwt-assertion-grant-type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left some suggestions.
const json = (await tokens.json()) as any | ||
if (!tokens.ok) { | ||
return { | ||
err: new InvalidJWTError(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
InvalidJWTError
is a bit too specific. Lots of other reasons why this could fail.
@@ -173,7 +173,7 @@ export function CodeProvider< | |||
const action = fd.get("action")?.toString() | |||
|
|||
if (action === "request" || action === "resend") { | |||
const claims = Object.fromEntries(fd) as Claims | |||
const claims = Object.fromEntries(fd.entries()) as Claims |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when I see fromX(something.toX())
I wonder if it's a no-op and there's a more direct way to get what we need.
packages/openauth/tsconfig.json
Outdated
@@ -7,7 +7,8 @@ | |||
"module": "NodeNext", | |||
"moduleResolution": "NodeNext", | |||
"jsx": "react-jsx", | |||
"jsxImportSource": "hono/jsx" | |||
"jsxImportSource": "hono/jsx", | |||
"types": ["node", "bun"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sus: it's either node or bun, not both.
Add support for grant-type assertions of jwts. jwk verifications is done but the custom success() handler does custom validation before access and refresh tokens are generated.