-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Unable to get services to auth against "admin" DB in Mongo; uses Hygieia's DB, instead #2877
Comments
I should mention that I can take the same setup and point it to a single-box Mongo where I added the user per the directions (e.g.: user lives in the same DB as Hygieia's data) and that works fine. |
@cjchand Can you help me understand what is your requirement? |
@rvema Sure! It is very common practice in Mongo to build users in the In fact, there is a Spring property for this: spring.data.mongodb.authentication-database. What I'm asking for is the ability to specify what DB to auth against. I tried setting Hope that helps! |
@cjchand Have you tried using |
@rvema Yes, it works if I add my account to the Hygieia DB itself. However, this is not standard practice for many MongoDB installs. Instead, all users - regardless of the DB(s) they use - are typically added to the So, the ask here is that there be a property to tell Hygieia services what DB to auth against. You can default it to the same DB Hygieia uses ( Hope that clarifies. |
@SohamJ No solution, unfortunately. Just the workaround of adding the user to the Hygieia DB. Based on the interaction thus far, I don't think they are understanding the problem. |
Any updates on this? |
Problem: When attempting to rehome to a new MongoDB, it fails to authenticate. Sniffer capture shows it is not using the
admin
DB in Mongo to authenticate, rather it is trying to auth against the DB where Hygieia will be storing its data.Relevant log excerpt:
... where
REDACTED_DB_NAME
is the name of the DB that Hygieia will store its data, should it be able to auth... which is the same DB I see in the sniffer caps it is trying to perform initial auth to, instead ofadmin
.I have connected to the same Mongo cluster with the same creds - though using the
admin
DB to auth, of course - and it works fine.I did try changing some of the Spring Boot config relevant to this (e.g.:
spring.data.mongodb.authentication-database=admin
), but no joy.Is there something I'm missing here, or is the code hardwired to assume that the user lives in Hygieia's DB, instead of
admin
?The text was updated successfully, but these errors were encountered: