Create Basic Auth User Credentials - mailslurper/mailslurper GitHub Wiki
When basic authentication is enabled in MailSlurper users must be setup so they can log in. There is a tool called createcredentials
, which is a small command-line tool, which will prompt for a user name and a password. This will generate a hash value which can be inserted into your config.json file. To begin, open your command prompt/terminal.
Windows
C:\mailslurper> createcredentials.exe
OSX/Linux
$ ./createcredentials
This will prompt you for a user name and a password like the screenshot below.
Once you've generated a user name and password, copy those values into your config.json file in the credentials section. Here is an example.
{
"wwwAddress": "127.0.0.1",
"wwwPort": 8080,
"serviceAddress": "127.0.0.1",
"servicePort": 8085,
"smtpAddress": "127.0.0.1",
"smtpPort": 2500,
"dbEngine": "SQLite",
"dbHost": "",
"dbPort": 0,
"dbDatabase": "./mailslurper.db",
"dbUserName": "",
"dbPassword": "",
"maxWorkers": 1000,
"keyFile": "",
"certFile": "",
"adminKeyFile": "",
"adminCertFile": "",
"authenticationScheme": "basic",
"authSecret": "my_secret_change_me",
"authSalt": "my_salt_change_me",
"authTimeoutInMinutes": 120,
"credentials": {
"adampresley": "$2a$10$ATIKSl5DwXewUhUI5witJuXmvY3d7j..8zP.f6z3IMmUOPJcIsTBW",
"maryanne": "$2a$10$ATIKSl5DwXewUhUI5witJuXmvY3d7j..8zP.f6z3IMmUOPJcIsTBW"
}
}