:question: Terrible newbie question here: I have s...
# orm-help
e
ā“ Terrible newbie question here: I have set up a Demo server in Prisma Cloud. Correct me if I am wrong, but there seems to be no authentication?. Once somebody knows the URL of this demo server, can they fire queries against it?
n
you can add a
secret
to
prisma.yml
to protect your Prisma API: https://www.prisma.io/docs/reference/prisma-api/concepts-utee3eiquo#authentication
e
Hi @nilan, thanks for the swift response! Makes me all happy and warm inside šŸ™‚
Don't understand how I could have missed this, it's even in the comments in
prisma.yml
thanks
šŸ™Œ 1
w
how does that works with JWT obtained from auth0?
a
the JWT you would use to protect your server (the one calling prisma)
w
exactly what i’m doing šŸ™‚ when i add secret to the prisma.yml and deploy it, every request from my server is unauthorised, that part im having hard time to understand. setup is std express/TS where i have middleware which is processing Auth header (auth0 JWT) .
a
what do you mean every request from your server? where are you getting an authorized error from? is it from your server calling prisma, or your client calling your server?
n
I'm not quite following, can you elaborate @woss šŸ™‚
w
@Avi Block & @nilan i went through the docs, examples and my code to find out what the heck is going on, it turns out that some of the variables were missing (.env) and misconfiguration (sending the wring JWT ) to different endpoints. It was(is) confusing for me to get my head around when prisma starts and ends without real deployments on different envs. I deployed prisma to app.prisma.sh and server to now.sh. then i tested it and it started making a lot of sense.
i would expect that
prisma deploy
deploys the directory i’m in(server source code) not just part of it (structure). i guess that was most confusing part