[JAVA-4154] MongoSecurityException: Exception authenticating MongoCredential Created: 13/May/21  Updated: 04/Oct/23  Resolved: 14/May/21

Status: Closed
Project: Java Driver
Component/s: Authentication
Affects Version/s: None
Fix Version/s: None

Type: Question Priority: Unknown
Reporter: Maniraj Deivendran Assignee: Ross Lawley
Resolution: Done Votes: 0
Labels: external-user
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

The environment is ppc64le/UBI 8.3 (RHEL 8.3 based docker container environment).
MongoDB server version: 4.4.4
Mongo driver version: 3.12.8



 Description   

Issue

Facing issues authenticating. The exception is:

com.mongodb.MongoSecurityException: 
 Exception authenticating MongoCredential{
  mechanism=SCRAM-SHA-1,
  userName='test', 
  source='dbName', 
  password=, 
  mechanismProperties=}
Caused by: com.mongodb.MongoCommandException: 
 Command failed with error 18 (AuthenticationFailed): 'Authentication failed.' on server localhost:33132. 
The full response is 
{
  "ok": 0.0, 
  "errmsg": "Authentication failed.",
  "code": 18, 
  "codeName": "AuthenticationFailed"
}

The connection string is of the form: mongodb://<user>:<password>@host:port/dbName

Likely causes

  • The user name and/or password is incorrect.
  • The dbName in the connection string is not the database in which the user is defined. Try removing it and use a connection string like: mongodb://<user>:<password>@host:port


 Comments   
Comment by Ross Lawley [ 14/May/21 ]

I'll look to follow up via the community forum

Comment by Maniraj Deivendran [ 13/May/21 ]

Hi Ross Lawley,

Thanks for your support.

I have raised the same issue in MongoDB community portal.
https://developer.mongodb.com/community/forums/t/mongosecurityexception-exception-authenticating-mongocredential/106790

Thanks,
Maniraj

Comment by Ross Lawley [ 13/May/21 ]

Hi [maniraj.deivendran@ibm.com

Thank you for reaching out. As this sounds like a support issue, I wanted to give you some resources to get this question answered more quickly:

  • Our MongoDB support portal, located at support.mongodb.com
  • Our MongoDB community portal, located here
  • If you are an Atlas customer, there is free support offered 24/7 in the lower right hand corner of the UI

Just in case you have already opened a support case and are not receiving sufficient help, please let me know and I can facilitate escalating your issue.

All the best,

Ross

Generated at Thu Feb 08 09:01:22 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.