servant-auth-client-0.4.1.0: servant-client/servant-auth compatibility

Safe HaskellNone
LanguageHaskell2010

Servant.Auth.Client

Synopsis

Documentation

newtype Token Source #

A simple bearer token.

Constructors

Token 

Fields

Instances
Eq Token Source # 
Instance details

Defined in Servant.Auth.Client.Internal

Methods

(==) :: Token -> Token -> Bool #

(/=) :: Token -> Token -> Bool #

Read Token Source # 
Instance details

Defined in Servant.Auth.Client.Internal

Show Token Source # 
Instance details

Defined in Servant.Auth.Client.Internal

Methods

showsPrec :: Int -> Token -> ShowS #

show :: Token -> String #

showList :: [Token] -> ShowS #

IsString Token Source # 
Instance details

Defined in Servant.Auth.Client.Internal

Methods

fromString :: String -> Token #

Generic Token Source # 
Instance details

Defined in Servant.Auth.Client.Internal

Associated Types

type Rep Token :: Type -> Type #

Methods

from :: Token -> Rep Token x #

to :: Rep Token x -> Token #

type Rep Token Source # 
Instance details

Defined in Servant.Auth.Client.Internal

type Rep Token = D1 (MetaData "Token" "Servant.Auth.Client.Internal" "servant-auth-client-0.4.1.0-1uxwX5nCone9LmIMp8LMXk" True) (C1 (MetaCons "Token" PrefixI True) (S1 (MetaSel (Just "getToken") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 ByteString)))

data Bearer Source #

A Bearer token in the Authorization header:

Authorization: Bearer token

This can be any token recognized by the server, for example, a JSON Web Token (JWT).

Note that, since the exact way the token is validated is not specified, this combinator can only be used in the client. The server would not know how to validate it, while the client does not care. If you want to implement Bearer authentication in your server, you have to choose a specific combinator, such as JWT.