# Django - Mongo Authentication fail

**URL:** <https://forum.djangoproject.com/t/django-mongo-authentication-fail/11704>\
**Category:** Using Django\
**Created:** [January 20, 2022, 10:06am UTC](https://forum.djangoproject.com/t/django-mongo-authentication-fail/11704 "2022-01-20T10:06:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mubashir-v](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/mubashir-v/32/6642_2.png) [@mubashir-v](https://forum.djangoproject.com/u/mubashir-v)\
**Post date:** [January 20, 2022, 10:06am UTC](https://forum.djangoproject.com/t/django-mongo-authentication-fail/11704/1 "2022-01-20T10:06:31Z")

</div>

Hi Guys,

I am facing Authentication failure issue while trying to migrate models to mongodb , Double checked username and password (able to connect mongo using MongoExpress using same credentials).

Following is the Database **settings** which I used .

```auto
DATABASES = {
        'default': {
            'ENGINE': 'djongo',
            'NAME': 'your-db-name',
            'ENFORCE_SCHEMA': False,
            'CLIENT': {
                'host': 'localhost',
                'port': 27017,
                'username': 'admin',
                'password': 'password',
            },
            'LOGGING': {
                'version': 1,
                'loggers': {
                    'djongo': {
                        'level': 'DEBUG',
                        'propagate': False,                        
                    }
                },
             },
        }
    }

```

**Error :**

```auto
raise OperationFailure(errmsg, code, response, max_wire_version)
pymongo.errors.OperationFailure: Authentication failed., full error: {'ok': 0.0, 'errmsg': 'Authentication failed.', 'code': 18, 'codeName': 'AuthenticationFailed'}

```

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [January 20, 2022, 1:07pm UTC](https://forum.djangoproject.com/t/django-mongo-authentication-fail/11704/2 "2022-01-20T13:07:26Z")

</div>

Since Djongo is a third-party package and not part of Django, you might get more direct and specific help in a Djongo-related area.

See [GitHub - nesdis/djongo: Django and MongoDB database connector](https://github.com/nesdis/djongo#questions-and-discussion) for some areas you can check.

(There might be some Djongo-knowledgeable people around here who would be happy to help, but your chances of getting assistance _may_ be better in one of those other locations.)
