HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Moduleservant-0.20.2Haskell2010

Servant.API.BasicAuth

  • 2 types
  • Packageservant-0.20.2
  • Exports2
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceBasicAuth.hs
datadata BasicAuth (realm :: Symbol) userData
#

Combinator for Basic Access Authentication.

  • IMPORTANT*: Only use Basic Auth over HTTPS! Credentials are not hashed or encrypted. Note also that because the same credentials are sent on every request, Basic Auth is not as secure as some alternatives. Further, the implementation in servant-server does not protect against some types of timing attacks.

In Basic Auth, username and password are base64-encoded and transmitted via the Authorization header. Handshakes are not required, making it relatively efficient.

Instances2HasLink, MkLink