supercharge / mongodb-github-action

Use MongoDB in GitHub Actions
MIT License
222 stars 46 forks source link

Authentication failed. #55

Closed Geolim4 closed 7 months ago

Geolim4 commented 7 months ago

Hello,

Despite the configuration I made: https://github.com/PHPSocialNetwork/mongodb-extension/blob/3f1b40d40d2716d55a5e4802f53b25d98be31f0e/.github/workflows/php.yml#L29

I still get the "Authentication failed." error: https://github.com/PHPSocialNetwork/mongodb-extension/actions/runs/7436987014/job/20234095568

I checked the DNS passed to the MongodbClient constructor and it look good to me: mongodb://test:phpfastcache@127.0.0.1/pfc_test

What am I missing ?

Geolim4 commented 7 months ago

Found it:

If you run the tests with the admin user, even if you specify the /databaseName in the DSN, you need to provide ?authSource=admin at the end of the DSN...

Closed :)

marcuspoehls commented 7 months ago

@Geolim4 Hey Georges, great you figured it out yourself 🙂 and thank you for sharing your solution!