homepage: https://github.com/martin-bednar/wai-middleware-bearer#readme
changelog-type: ''
hash: bc3e7edbfe0fe9a2bed5c538a009a1a53cace5eae3871dfc29572ddb54fca502
test-bench-deps:
  bytestring: '>=0.10.12.1 && <1'
  wai: '>=3.2.3 && <4'
  base: '>=4.7 && <5'
  hspec: -any
  wai-middleware-bearer: -any
  word8: '>=0.1.3 && <1'
  hspec-wai: -any
  http-types: '>=0.12.3 && <1'
maintainer: bednam17@fit.cvut.cz
synopsis: WAI Middleware for Bearer Token Authentication
changelog: ''
basic-deps:
  bytestring: '>=0.10.12.1 && <1'
  wai: '>=3.2.3 && <4'
  base: '>=4.7 && <5'
  word8: '>=0.1.3 && <1'
  http-types: '>=0.12.3 && <1'
all-versions:
- 1.0.3
author: Martin Bednar
latest: 1.0.3
description-type: markdown
description: "# wai-middleware-bearer\n\nWAI middleware providing [bearer token authentication](https://swagger.io/docs/specification/authentication/bearer-authentication/).\n##
  Usage example\n\nThe following code shows a secure **Hello World** application:\n\n```haskell\n{-#
  LANGUAGE OverloadedStrings #-}\nmodule Main where\n\nimport Network.Wai.Middleware.BearerTokenAuth\nimport
  Network.Wai\nimport Network.HTTP.Types.Status (status200)\nimport Network.Wai.Handler.Warp
  (run)\n\nmyApp :: Application\nmyApp req rsp = rsp $ responseLBS status200 [] \"Hello
  World\"\n\nsecureApp :: Application\nsecureApp = tokenListAuth [\"abc\", \"123\"]
  myApp\n\nmain :: IO ()\nmain = run 3000 secureApp\n```\n\nValid token request example
  (200 OK):\n```sh\n$ curl -H \"Authorization: bearer abc\" 'localhost:3000'\n\nHello
  World⏎\n```\n\nInvalid token request example (401 Unauthorized):\n```sh\n$ curl
  -H \"Authorization: bearer otherToken\" 'localhost:3000'\n\nBearer token authentication
  is required⏎ \n```\n\nMissing token request example (401 Unauthorized):\n```sh\ncurl
  'localhost:3000'\n\nBearer token authentication is required⏎\n```\n"
license-name: MIT

Update from Hackage at 2022-05-26T12:26:08Z
Update from Hackage at 2022-05-26T12:26:08Z
