Safe Haskell | None |
---|---|
Language | Haskell2010 |
- wwwAuthenticatedErr :: ByteString -> ServantErr
- type family BasicAuthCfg
- class FromBasicAuthData a where
- basicAuthCheck :: FromBasicAuthData usr => BasicAuthCfg -> AuthCheck usr
Documentation
wwwAuthenticatedErr :: ByteString -> ServantErr Source #
A ServantErr
that asks the client to authenticate via Basic
Authentication, should be invoked by an application whenever
appropriate. The argument is the realm.
type family BasicAuthCfg Source #
class FromBasicAuthData a where Source #
fromBasicAuthData :: BasicAuthData -> BasicAuthCfg -> IO (AuthResult a) Source #
Whether the username exists and the password is correct.
Note that, rather than passing a Pass
to the function, we pass a
function that checks an EncryptedPass
. This is to make sure you don't
accidentally do something untoward with the password, like store it.
basicAuthCheck :: FromBasicAuthData usr => BasicAuthCfg -> AuthCheck usr Source #