iegomez / mosquitto-go-auth

Auth plugin for mosquitto.
MIT License
522 stars 172 forks source link

MongoDB Connection Error #129

Closed robinschneider closed 3 years ago

robinschneider commented 3 years ago

Hello, every time I try to connect with my user I get the same error:

level=debug msg="Mongo get user error: connection() : auth error: sasl conversation error: unable to authenticate using mechanism \"SCRAM-SHA-1\": (AuthenticationFailed) Authentication failed."

I read about the same Issue here https://github.com/iegomez/mosquitto-go-auth/issues/57 but it was marked as solved and merged and I used the latest version and still got that issue.

My configuration:

mosquitto.conf

persistence true
persistence_location /var/lib/mosquitto/

log_type all

listener 1883
protocol mqtt

listener 1884
protocol websockets

allow_anonymous false
include_dir /etc/mosquitto/conf.d

go-auth.conf

auth_plugin /mosquitto/go-auth.so

auth_opt_backends mongo
auth_opt_check_prefix false

auth_opt_hasher bcrypt
auth_opt_hasher_cost 10
auth_opt_log_level debug
auth_opt_cache true

auth_opt_mongo_host 192.168.178.98
auth_opt_mongo_port 27017
auth_opt_mongo_dbname mqtt
auth_opt_mongo_username username
auth_opt_mongo_password password
auth_opt_mongo_users users
auth_opt_mongo_acls acls
auth_opt_mongo_disable_superuser false

docker-compose.yml

version: "3"
services:
  mosquitto_auth:
    image: iegomez/mosquitto-go-auth:latest
    container_name: mosquitto_auth
    restart: always
    networks:
     - mqtt_network
    volumes:
      - ./conf:/etc/mosquitto

networks:
  mqtt_network:
    external:
      name: mqtt_network

I can connect with other applications such as MongoDB Compass to my db with this credentials.

iegomez commented 3 years ago

Hey, @robinschneider! Sorry for the late response, this has been a busy week and I haven't been able to dedicate any time to the plugin. I'll try checking when I get some things off the backlog.

Cheers!

robinschneider commented 3 years ago

@iegomez Nevermind, I just failed.