Verify or sign requests with HMAC signatures
masterYou can increase security by using HMAC signatures for request verification or signing.
- Signing: Enabled via
--enable-hmacin forward-signing mode. Gatekeeper creates a signature and passes it in theX-HMAC-SHA256header. - Verification: Performed when using Gatekeeper as an authentication/authorization proxy.
The signature is generated by signing a string formatted as follows:
stringToSign := fmt.Sprintf(
"%s\n%s%s\n%s;%s;%s",
req.Method,
req.URL.Path,
req.URL.RawQuery,
req.Header.Get(constant.AuthorizationHeader),
req.Host,
sha256.Sum256(body),
)