Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authentication Failure #66

Open
adimyth opened this issue Feb 26, 2022 · 0 comments
Open

Authentication Failure #66

adimyth opened this issue Feb 26, 2022 · 0 comments
Assignees

Comments

@adimyth
Copy link

adimyth commented Feb 26, 2022

Describe the bug
Authentication error when trying to connect to Mongo. I get the following error when trying to connect to mongo using user credentials -

{
    "error": "connection() error occured during connection handshake: auth error: sasl conversation error: unable to authenticate using mechanism \"SCRAM-SHA-1\": (AuthenticationFailed) Authentication failed.",
    "ok": false
}

I am able to login via mongo-shell using the same creds as in the screenshot below. However the ORM throws error -

Screenshot 2022-02-26 at 6 45 08 PM

Note: This is similar to this closed issue.

To Reproduce
Steps to reproduce the behavior:

  1. Create a test user with the following creds -
    MONGODB_PORT="27017"
    MONGODB_URL="localhost"
    MONGODB_USERNAME="test"
    MONGODB_PASSWORD="test123"
    MONGODB_DB="todos"
  2. Connect to mongo using the ODM
    package main
    
    import (
    	"log"
    
    	"github.com/Kamva/mgm/v2"
    	"go.mongodb.org/mongo-driver/mongo/options"
    )
    
    func init() {
    	err = mgm.SetDefaultConfig(nil, "todos", options.Client().ApplyURI("mongodb://test:test123@localhost:27017"))
    	if err != nil {
    		log.Fatal("Error setting default config")
    		log.Fatal(err)
    	}
    }

Expected behavior
Connection should not fail when trying to connect via above piece of code

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • OS: MacOS Big Sur
  • Mongo: v5.0.6

Additional context
Add any other context about the problem here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants