Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Common types and functions related to authorization.
Synopsis
- type AuthorizationHeader scheme = RequestHeader Optional Lenient "Authorization" (AuthToken scheme)
- newtype Realm = Realm ByteString
- data AuthToken (scheme :: Symbol) = AuthToken {}
- respondUnauthorized :: (Handler h m, Sets h [Status, RequiredResponseHeader "Content-Type" Text, RequiredResponseHeader "WWW-Authenticate" Text, Body PlainText Text] Response) => CI ByteString -> Realm -> h a Response
Documentation
type AuthorizationHeader scheme = RequestHeader Optional Lenient "Authorization" (AuthToken scheme) Source #
Trait for "Authorization" header
The protection space for authentication
data AuthToken (scheme :: Symbol) Source #
The components of Authorization request header
AuthToken | |
|
Instances
KnownSymbol scheme => FromHttpApiData (AuthToken scheme) Source # | |
Defined in WebGear.Core.Trait.Auth.Common parseUrlPiece :: Text -> Either Text (AuthToken scheme) # parseHeader :: ByteString -> Either Text (AuthToken scheme) # |
:: (Handler h m, Sets h [Status, RequiredResponseHeader "Content-Type" Text, RequiredResponseHeader "WWW-Authenticate" Text, Body PlainText Text] Response) | |
=> CI ByteString | The authentication scheme |
-> Realm | The authentication realm |
-> h a Response |
Create a "401 Unauthorized" response.
The response will have a plain text body and an appropriate "WWW-Authenticate" header.