Introduction
This procedure explains how to switch the authentication mechanism directly from the database via mongoshell.
Step 1:
On the server terminal
To know the present authentication mode, run the following command
> echo "db.settings.find().pretty()" | mongo settings
[The above will not work if mongoDB authentication is enabled.]
If authentication is enabled then log in to mongo with the admin user and password.
Example:
mongo -u "myUserAdmin" -p "pass" --authenticationDatabase "admin" admin
use settings
db.settings.find().pretty()
Step 2:
Switch to Local via Mongo shell
[root@ssafield01-01 ~]# mongo
connecting to: test
indexers:PRIMARY> use settings
switched to db settings
indexers:PRIMARY> db.settings.update({"settings.Auth.mode" : "ldap"},{$set:{"settings.Auth.mode" : "local"}})
WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 1 })
Redo Step 1
Step 3:
Restart the SES-console.
systemctl restart systran-ses-console
Connect to the web interface :
admin@systran.fr SESpassword
The same steps can be followed to switch back the LDAP or SAML Authentication mode
Switch from Local via Mongo shell to LDAP :
indexers:PRIMARY> db.settings.update({"settings.Auth.mode" : "local"},{$set:{"settings.Auth.mode" : "ldap"}}) WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 1 })
Repeat the steps 3 & 1