-
Notifications
You must be signed in to change notification settings - Fork 23
Authorization
Will Trimble edited this page Sep 9, 2019
·
4 revisions
TODO: add documentation
While not recommended for production, basic auth can be useful for testing and development. Users are stored with their username and password in the mongo database.
Enable with basic auth using:
shock-server --basic=true --users=admin
Users listed under --users are only users with admin rights !
Add normal user to database:
docker exec -ti test_shock-mongo_1 mongo
use ShockDB;
db.Users.insert({ username: "user1", password: "secret"})
db.Users.findOne()
or update password
db.Users.findOne({ username: "user1"})
db.Users.update({ username: "user1"}, { $set : {password: "newsecret" }})
For each user create base64-encoded credentials that can be used to access Shock.
echo -n 'user1:secret' | base64
curl -H 'Authorization: basic dXNlcjE6c2VjcmV0' <shock-api>/node...