N
Neon12mo ago
conscious-sapphire

Neon Authorize with one project per user

Hi, I have being playing with Neon Authorize and was about to try it with a one project per user. This needs a custom JWT endpoint per tenant and a JWT per user per tenant so the SUB can be the user in the tenant database. It's there a way to configure the endpoint with the Neon API? https://neon.tech/api_spec/release/v2.json
7 Replies
optimistic-gold
optimistic-gold12mo ago
It's there a way to configure the endpoint with the Neon API?
I don't think so cc @David Gomes
rival-black
rival-black12mo ago
We only support setting a JWKS URL per project I think that in order to achieve this you'd need to automate the project creation, such that for each created project, you'd immediately set up a JWKS URL for that project
conscious-sapphire
conscious-sapphireOP10mo ago
We have currently this code to create projects
const neonDatabase = await neonApiClient.POST("/projects", {
body: {
project: {
name: newId,
pg_version: 17,
region_id: "aws-us-east-1",
},
},
})
const neonDatabase = await neonApiClient.POST("/projects", {
body: {
project: {
name: newId,
pg_version: 17,
region_id: "aws-us-east-1",
},
},
})
It's possible or planned to do something like:
const neonDatabase = await neonApiClient.POST("/projects", {
body: {
project: {
name: newBusinessId,
pg_version: 17,
region_id: "aws-us-east-1",
jwt_endpoint: "https://..." // => ?
},
},
})
const neonDatabase = await neonApiClient.POST("/projects", {
body: {
project: {
name: newBusinessId,
pg_version: 17,
region_id: "aws-us-east-1",
jwt_endpoint: "https://..." // => ?
},
},
})
Hi, have there been any updates on setting the jwt endpoint for Neon Authorize via code?
deep-jade
deep-jade10mo ago
Neon
Adds a JWKS URL to a project
Add a new JWKS URL to a project, such that it can be used for verifying JWTs used as the authentication mechanism for the specified project. The URL must be a valid HTTPS URL that returns a JSON Web Key Set. The provider_name field allows you to specify which authentication provider you're using (e....
deep-jade
deep-jade10mo ago
Just await your POST to create the project normally, get the ID, then add the JWKS to it
conscious-sapphire
conscious-sapphireOP10mo ago
Yep, that is, time to play But I saw your job at https://discord.com/channels/1176467419317940276/1303805647816757339 and I really liked it, great job 😄
deep-jade
deep-jade10mo ago
ty ty

Did you find this page helpful?