Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6156369
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:35:51+00:00 2026-05-23T20:35:51+00:00

When you login as admin user (user of admin database) in MongoDB console, you

  • 0

When you login as admin user (user of admin database) in MongoDB console, you can then have full access to any database on the same server without need to login to each of them.
But, if I use the official C# driver and provide connection string to admin database, then when I am trying to access any other database, I get authentication error. It’s happening in MongoServerInstance.AcquireConnection() where it’s trying to re-authenticate the connection and checks admin database credentials against the other database which of course fails.

What I’m trying to achieve is – I provide admin connection string and get access to all databases without the need to login to each and every one of them, exactly like the console does

Anything I can do to make C# driver work the same way as the console does in terms of authentication?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T20:35:51+00:00Added an answer on May 23, 2026 at 8:35 pm

    After I digged into MongoDB driver’s authentication code, I found that you need to add ‘(admin)’ after admin username in the connection string to tell the driver that this is in fact an admin login. After doing that everything works as expected!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have set up a small SQL Server database for users to login and
I want to create one user (admin) and I want to use console (without
I have a User and an Admin role in my project. I created my
Errors Database administrators report Microsoft SQL Server 2008 server-side error Invalid Login (error 18456,
very simple question: I have admin site in my web project. So, how can
I have created a simple login page for asp.net which takes in user name
We have a system that uses a SQL server 2005 database with a number
I'm trying to get the user's login details from the database using $SETTINGS[admin_username] and
I have a login control in login.aspx page that validates user by checking in
I have a comment page, and where I have user roles(Global Admin(3), Admin(2), User(1)),

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.