hsoz: Iron, Hawk, Oz: Web auth protocols

[ authentication, bsd3, library, web ] [ Propose Tags ]

hsoz is a Haskell implementation of the Iron, Hawk, and Oz web authentication protocols. These protocols originate from the OAuth2 standardisation process, but are designed to be simpler to implement for the common case of web applications.

The top-level Network.Iron, Network.Hawk, Network.Oz modules contain further instructions on their usage. There are also some example server and client programs within the project git repository.

[Skip to Readme]
Versions [faq],,,
Dependencies aeson, attoparsec, base (>=4.7 && <5), base16-bytestring, base64-bytestring, byteable, bytestring, case-insensitive, containers, cryptonite, data-default, either, errors, exceptions, hashable, hsoz, http-client (==0.4.*), http-conduit (==2.1.*), http-types, lens, lucid, memory, mtl, network, optparse-applicative (==0.12.*), scientific, scotty, securemem, text, time, transformers, unordered-containers, uri-bytestring, vault, wai, warp [details]
License BSD-3-Clause
Copyright 2016 Rodney Lorrimar
Author Rodney Lorrimar
Maintainer Rodney Lorrimar <dev@rodney.id.au>
Revised Revision 1 made by rvl at Sun Feb 5 22:24:35 UTC 2017
Category Web, Authentication
Home page https://github.com/rvl/hsoz
Bug tracker https://github.com/rvl/hsoz/issues
Source repo head: git clone https://github.com/rvl/hsoz
Uploaded by rvl at Fri Feb 3 06:28:44 UTC 2017
Distributions NixOS:
Executables iron, hsoz-example
Downloads 1174 total (42 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs not available [build log]
All reported builds failed as of 2017-02-03 [all 3 reports]


  • Network
    • Network.Hawk
      • Network.Hawk.Client
      • Network.Hawk.Internal
        • Network.Hawk.Internal.Client
          • Network.Hawk.Internal.Client.HeaderParser
          • Network.Hawk.Internal.Client.Types
        • Network.Hawk.Internal.Server
          • Network.Hawk.Internal.Server.Header
          • Network.Hawk.Internal.Server.Types
        • Network.Hawk.Internal.Types
      • Network.Hawk.Middleware
      • Network.Hawk.Server
        • Network.Hawk.Server.Nonce
      • Network.Hawk.Types
      • Network.Hawk.URI
    • Network.Iron
    • Network.Oz
      • Network.Oz.Application
      • Network.Oz.Client
      • Network.Oz.Server
      • Network.Oz.Ticket
      • Network.Oz.Types



Build the example applications


Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info


Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

For package maintainers and hackage trustees

Readme for hsoz-

[back to package description]

Oz Haskell Implementation

Build Status Hackage

hsoz is a Haskell implementation of the Iron, Hawk, and Oz web authentication protocols. These protocols originate from the OAuth2 standardisation process, but are designed to be simpler to implement for the common case of web applications.


In the words of their principal designer:

Iron is a cryptographic utility for sealing a JSON object using symmetric key encryption with message integrity verification. Or in other words, it lets you encrypt an object, send it around (in cookies, authentication credentials, etc.), then receive it back and decrypt it. The algorithm ensures that the message was not tampered with, and also provides a simple mechanism for password rotation.

Hawk is an HTTP authentication scheme using a message authentication code (MAC) algorithm to provide partial HTTP request cryptographic verification.

Oz is a web authorization protocol based on industry best practices. Oz combines the Hawk authentication protocol with the Iron encryption protocol to provide a simple to use and secure solution for granting and authenticating third-party access to an API on behalf of a user or an application.


The Haddock documentation is on Hackage and at https://rodney.id.au/docs/hsoz/.

Example Usage

See the Network.Iron documentation, and the example directory of this repository.


This is an in-progress experiment in implementing the protocol in Haskell.

  • Iron: complete
  • Hawk: complete
  • Oz: under construction.
  • Example web application: under construction.

Please note: until the example application is built, this library cannot be considered "battle-tested".

There is also an org-mode file: todo.org.


I welcome collaborators, particularly anyone who would like to develop authentication plugins for frameworks such as Snap and Servant, or a manager for Wreq.

Building with Stack

stack build

Building with Nix

nix-shell -p cabal2nix --command "cabal2nix --shell . > default.nix"
nix-shell --command "cabal configure"
cabal build


This module is based on the Javascript code and documentation by Eran Hammer and others. A fair amount of Hammer's descriptive text has been incorporated into this documentation, as well as the cool logos.