Mongo Atlas Random Message: "BadValue: SCRAM-SHA-256 authentication is disabled"
Asked Answered
F

1

7

I'm getting the following random message on my Mongo Atlas "Access History" view:

"FAILED BadValue: SCRAM-SHA-256 authentication is disabled"

This message is attached to my application IP hosted at AWS. I basically got this message first and then the success message at the same timestamp.

  • Instance MongoAtlas - Cluster Tier M40 General
  • Replica Set - 3 nodes
  • Driver mongoose: “^6.5.1”
  • Mongo version as per Atlas view: 5.0.12
  • Mongo String URI: mongodb+srv://xyz:[email protected]/my_db

Is that an issue while connecting to Mongo?

Fulsome answered 28/9, 2022 at 1:1 Comment(0)
L
1

This error BadValue: SCRAM-SHA-256 authentication is disabled caused by the Mongo-atlas does NOT support SCRAM-SHA-256, but does support SCRAM-SHA-1.

Notably, MongoDB authentication protocols do not use SHA-1 as a raw hash function for passwords or digital signatures, but rather as an HMAC construction in, e.g., SASL SCRAM-SHA-1. While many common uses of SHA-1 have been deprecated or sunset by standards organizations, these do not typically apply to HMAC functions.

Generally speaking, this error happendd on the user mms-automation or mms-monitoring-agent. Both of them are used for Atlas internal tasks including monitoring.

The source of this message is that mms-automation user initially attempts authentication using SCRAM-SHA-256 which Atlas doesn’t support, causing the “BadValue: SCRAM-SHA-256 authentication is disabled” message, before falling back to SCRAM-SHA-1.

Note that there is NO detrimental effect to the operation of the database, and this informational message is provided for your own auditing purposes.


If there is connection issue, you could change the authentication mechanism to SCRAM-SHA-1. In a connection string, specify authMechanism=SCRAM-SHA-1

mongodb://username:password@host:port/database?authMechanism=SCRAM-SHA-1

Source: https://www.mongodb.com/community/forums/t/badvalue-scram-sha-256-authentication-is-disabled/143254/4

Lp answered 22/8 at 14:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.