Skip to content

Commit 058e58f

Browse files
thomasballingerConvex, Inc.
authored and
Convex, Inc.
committed
More custom JWT docs (#37287)
GitOrigin-RevId: 8261958bce47beb3e69c56d4403b488c09571b05
1 parent 77209e7 commit 058e58f

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

npm-packages/docs/docs/auth/advanced/custom-auth.mdx

+20-1
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,32 @@ Add these to your `convex/auth.config.js` file:
2929
export default {
3030
providers: [
3131
{
32-
domain: "your.issuer.url.com",
32+
domain: "https://your.issuer.url.com",
3333
applicationID: "your-application-id",
3434
},
3535
],
3636
};
3737
```
3838

39+
The `applicationID` property must exactly match the `aud` field of your JWT and
40+
the `domain` property must exactly match the `iss` field of the JWT. Use a tool
41+
like [jwt.io](https://jwt.io/) to view an JWT and confirm these fields match
42+
exactly.
43+
44+
If multiple providers are provided, the first one fulfilling the above criteria
45+
will be used.
46+
47+
If you're not able to obtain tokens with an `aud` field, you'll need to instead
48+
configure a [Custom JWT](/auth/advanced/custom-jwt.mdx). If you're not sure if
49+
your token is an OIDC ID token, check
50+
[the spec](https://openid.net/specs/openid-connect-core-1_0-final.html#rfc.section.2)
51+
for a list of all required fields.
52+
53+
OIDC requires the routes `${domain}/.well-known/jwks.json` and
54+
`${domain}/.well-known/openid-configuration`. `domain` may include a path like
55+
`https://your.issuer.url.com/api/auth`. This isn't common for third party auth
56+
providers but may be useful if you're implementing OIDC on your own server.
57+
3958
## Client-side integration
4059

4160
### Integrating a new identity provider

npm-packages/docs/docs/auth/advanced/custom-jwt.mdx

+5
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ export default {
4242
[RFC 7518](https://datatracker.ietf.org/doc/html/rfc7518#section-3.1) for more
4343
details.
4444

45+
The `issuer` property must exactly match the `iss` field of the JWT used, and if
46+
specified the `applicationID` property must exactly match the `aud` field. If
47+
your JWT doesn't match, use a tool like [jwt.io](https://jwt.io/) to view an JWT
48+
and confirm these fields match exactly.
49+
4550
## Client-side integration
4651

4752
See the instructions for

0 commit comments

Comments
 (0)