Prisma does not support Mongodb SCRAM-SHA-256 authentication mechanism
See original GitHub issueBug description
My Db uses SCRAM-SHA-256 as the authentication mechanism. I can connect to it using Mongo Compass, but Prisma cannot connect.
How to reproduce
- set the environment variable
DATABASE_URL="mongodb://*****:*****@*.*.*.*:3051/message_db&authSource=message_db&authMechanism=SCRAM-SHA-256?authSource=message_db&readPreference=primary&appname=MongoDB%20Compass&directConnection=true&ssl=false"
npx prisma studio
Expected behavior
No response
Prisma information
The normal operation
datasource db {
provider = "mongodb"
url = env("DATABASE_URL")
}
generator client {
provider = "prisma-client-js"
previewFeatures = ["mongoDb"]
}
Environment & setup
- OS:
- Database:
- Node.js version: OS: Debian Database: Mongo Node.js version: v14.17.5
Prisma Version
prisma : 3.0.2
@prisma/client : 3.0.1
Current platform : debian-openssl-1.1.x
Query Engine (Node-API) : libquery-engine 2452cc6313d52b8b9a96999ac0e974d0aedf88db (at ../../../../../.npm/_npx/3091863/lib/node_modules/prisma/node_modules/@prisma/engines/libquery_engine-debian-openssl-1.1.x.so.node)
Migration Engine : migration-engine-cli 2452cc6313d52b8b9a96999ac0e974d0aedf88db (at ../../../../../.npm/_npx/3091863/lib/node_modules/prisma/node_modules/@prisma/engines/migration-engine-debian-openssl-1.1.x)
Introspection Engine : introspection-core 2452cc6313d52b8b9a96999ac0e974d0aedf88db (at ../../../../../.npm/_npx/3091863/lib/node_modules/prisma/node_modules/@prisma/engines/introspection-engine-debian-openssl-1.1.x)
Format Binary : prisma-fmt 2452cc6313d52b8b9a96999ac0e974d0aedf88db (at ../../../../../.npm/_npx/3091863/lib/node_modules/prisma/node_modules/@prisma/engines/prisma-fmt-debian-openssl-1.1.x)
Default Engines Hash : 2452cc6313d52b8b9a96999ac0e974d0aedf88db
Studio : 0.423.0
Preview Features : mongoDb
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
MongoDB Users and Authentication - Create, List, and Delete
Find out how to configure user accounts and set up authentication credentials on your MongoDB server, including how to create, delete, and show...
Read more >Authentication Mechanisms — Node.js - MongoDB
SCRAM -SHA-256 is a salted challenge-response authentication mechanism (SCRAM) that uses your username and password, encrypted with the SHA-256 algorithm to ...
Read more >I cant start a project with Prisma with local Mongodb
You probably need to fix the URI. The standard mongodb URI connection scheme has the form: mongodb://[username:password@]host1[:port1][,.
Read more >Authentication and DB access with Next, Prisma, and MongoDB
A MongoDB Database. Make sure that your MongoDB deployment is configured with replica sets to be able to integrate with Prisma. You can...
Read more >Password authentication | YugabyteDB Docs
Password authentication · Password authentication methods · YugabyteDB database passwords · Enable SCRAM-SHA-256 authentication · Create a cluster that uses SCRAM- ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, you specify parameters in the connection string format after
?
and join multiple of them using&
.Looks like this is resolved then.
I think I found the problem. I change the & of my Url to ? then the service can be accessed normally.