Sanjay R
Sanjay R4mo ago

I have cloned the convex-auth-example chat app

There is one problem, while running locally, I can't sign in with a password, at first it shows there is no JWT_PRIVATE_KEY but the data is stored in the database. Then I added JWT_PRIVATE_KEY in .env at convex. Now if I sign in with a password, it shows this error,
SignInWithPassword.tsx:32 Error: [CONVEX A(auth:signIn)] [Request ID: f6fe557261498] Server Error
Uncaught Error: Uncaught TypeError: "pkcs8" must be PKCS#8 formatted string
SignInWithPassword.tsx:32 Error: [CONVEX A(auth:signIn)] [Request ID: f6fe557261498] Server Error
Uncaught Error: Uncaught TypeError: "pkcs8" must be PKCS#8 formatted string
What is the problem?
5 Replies
Convex Bot
Convex Bot4mo ago
Thanks for posting in <#1088161997662724167>. Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets. - Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.) - Use search.convex.dev to search Docs, Stack, and Discord all at once. - Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI. - Avoid tagging staff unless specifically instructed. Thank you!
sshader
sshader4mo ago
What does the output of npx convex env list look like? Do you see a JWT_PRIVATE_KEY? Convex environment variables are configured via npx convex env set or in the dashboard, not via .env files
Sanjay R
Sanjay ROP4mo ago
I have actually configured the env at convex. When I run npx convex env list the below is the output JWT_PRIVATE_KEY=asdfadgdf
but I am getting this error
SignInWithPassword.tsx:32 Error: [CONVEX A(auth:signIn)] [Request ID: 45193d5d29026f] Server Error
Uncaught Error: Uncaught TypeError: "pkcs8" must be PKCS#8 formatted string
SignInWithPassword.tsx:32 Error: [CONVEX A(auth:signIn)] [Request ID: 45193d5d29026f] Server Error
Uncaught Error: Uncaught TypeError: "pkcs8" must be PKCS#8 formatted string
sshader
sshader4mo ago
The key should have a specific format (as an example, here's the beginning of mine JWT_PRIVATE_KEY=-----BEGIN PRIVATE KEY----- MIIEvg...). This is usually set by running npx @convex-dev/auth or manually generating them with a script (https://labs.convex.dev/auth/setup/manual#configure-private-and-public-key). Have you done this set up?
Manual Setup - Convex Auth
Authentication library for your Convex backend
Sanjay R
Sanjay ROP4mo ago
thank you! it works

Did you find this page helpful?