Skip to content

Commit

Permalink
Adds login via token mechanism
Browse files Browse the repository at this point in the history
- users update/create API accepts a new parameter called `token_login` that enables or disables the feature for a user
- when this feature is enabled, the user can only login by accessing a link that is sent to them by SMS. This link will log them in automatically without the need of entering other credentials. Regular login is not possible because nobody knows the user's actual password. 
- generated tokens are valid for 24 hours
- tokens can be regenerated - in this case the old token becomes invalid.

#6380
  • Loading branch information
dianabarsan authored Jul 28, 2020
1 parent 80b50ac commit 4b24613
Show file tree
Hide file tree
Showing 35 changed files with 4,603 additions and 867 deletions.
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ module.exports = function(grunt) {
`curl 'http://localhost:4984/_cluster_setup' -H 'Content-Type: application/json' --data-binary '{"action":"enable_single_node","username":"admin","password":"pass","bind_address":"0.0.0.0","port":5984,"singlenode":true}'`,
'COUCH_URL=http://admin:pass@localhost:4984/medic COUCH_NODE_NAME=nonode@nohost grunt secure-couchdb', // yo dawg, I heard you like grunt...
// Useful for debugging etc, as it allows you to use Fauxton easily
`curl -X PUT "http://admin:pass@localhost:4984/_node/nonode@nohost/_config/httpd/WWW-Authenticate" -d '"Basic realm=\\"administrator\\""' -H "Content-Type: application/json"'`
`curl -X PUT "http://admin:pass@localhost:4984/_node/nonode@nohost/_config/httpd/WWW-Authenticate" -d '"Basic realm=\\"administrator\\""' -H "Content-Type: application/json"`
].join('&& ')
},
'clean-test-database': {
Expand Down
4 changes: 4 additions & 0 deletions admin/src/css/configuration.less
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ dl.horizontal {
min-width: 100%;
margin-left: -15px;
margin-right: -15px;
table-layout: fixed;
td.break {
word-break: break-word;
}
}
td,
th {
Expand Down
Loading

0 comments on commit 4b24613

Please sign in to comment.