Find file History
Latest commit 040ca3a Jan 8, 2017 @krdlab Refactor
Permalink
..
Failed to load latest commit information.
app
src
test
.gitignore
LICENSE
README.md
Setup.hs
stack.yaml
try-haskell-servant-auth.cabal

README.md

Try authentication in Servant

http://haskell-servant.readthedocs.io/en/stable/tutorial/Authentication.html

$ stack setup
$ stack build
$ stack exec try-haskell-servant-auth

$ curl localhost:3000/public
"public resource"

$ curl localhost:3000/account
Missing token header

$ curl localhost:3000/account -H 'X-Servant-Auth-Token: token1'
{"name":"account1"}

$ curl localhost:3000/account -H 'X-Servant-Auth-Token: unknown-token'
Invalid token