Basic authentication
Basic authentication is the simplest technique for authenticating HTTP requests. The client
sends an Authorization
header with a Base64-encoded string of username:password
, prefixed by Basic
. For example,
to authenticate as demo
/s3cr3t
:
1 |
|
Configuration
Martini supports basic authentication out-of-the-box, albeit disabled by default. Base64 is easily decoded, hence you should only enable this with HTTPS/SSL configured on your instance.
You can enable basic authentication via the application property:
1 |
|
For changes to take effect, a restart is required
For Martini to pick up the api.rest.enable-basic-authentication
's new value, an instance restart must be applied first.