Basic Auth Policy
The Basic Authentication policy allows you to authenticate incoming requests using the Basic authentication standard. You can configure multiple accounts with different passwords and a different bucket of user 'data'.
The API will expect a Basic Auth header (you can generate samples
here). Requests with
invalid credentials (or no header) will not be authenticated. Authenticated
requests will populate the user
property of the ZuploRequest
parameter on
your RequestHandler.
Configuration
{
"name": "my-basic-auth-inbound-policy",
"policyType": "basic-auth-inbound",
"handler": {
"export": "BasicAuthInboundPolicy",
"module": "$import(@zuplo/runtime)",
"options": {
"accounts": [
{
"data": {
"number": 1
},
"password": "PASSWORD",
"username": "USERNAME"
}
],
"allowUnauthenticatedRequests": false
}
}
}
Read more about how policies work