License | BSD3 |
---|---|
Maintainer | Fumiaki Kinoshita <fumiexcel@gmail.com> |
Safe Haskell | None |
Language | Haskell2010 |
WebAuthn
Contents
Description
Web Authentication API Verification library
Synopsis
- data TokenBinding
- data Origin = Origin {
- originScheme :: Text
- originHost :: Text
- originPort :: Maybe Int
- data RelyingParty = RelyingParty {}
- defaultRelyingParty :: Origin -> RelyingParty
- data User = User {}
- newtype Challenge = Challenge {}
- generateChallenge :: Int -> IO Challenge
- data WebAuthnType
- data CollectedClientData = CollectedClientData {}
- data AuthenticatorData = AuthenticatorData {}
- data AttestedCredentialData = AttestedCredentialData {}
- newtype AAGUID = AAGUID {}
- newtype CredentialPublicKey = CredentialPublicKey {}
- newtype CredentialId = CredentialId {}
- data VerificationFailure
- = InvalidType
- | MismatchedChallenge
- | MismatchedOrigin
- | UnexpectedPresenceOfTokenBinding
- | MismatchedTokenBinding
- | JSONDecodeError String
- | CBORDecodeError String DeserialiseFailure
- | MismatchedRPID
- | UserNotPresent
- | UserUnverified
- | UnsupportedAttestationFormat
- | UnsupportedAlgorithm Int
- | MalformedPublicKey
- | MalformedAuthenticatorData
- | MalformedX509Certificate
- | MalformedSignature
- | SignatureFailure String
- registerCredential :: Challenge -> RelyingParty -> Maybe Text -> Bool -> ByteString -> ByteString -> Either VerificationFailure AttestedCredentialData
- verify :: Challenge -> RelyingParty -> Maybe Text -> Bool -> ByteString -> ByteString -> ByteString -> CredentialPublicKey -> Either VerificationFailure ()
Basic
data TokenBinding Source #
state of the Token Binding protocol (unsupported)
Instances
FromJSON TokenBinding Source # | |
Defined in WebAuthn.Types |
Constructors
Origin | |
Fields
|
data RelyingParty Source #
WebAuthn Relying Party
Constructors
RelyingParty | |
Fields |
Instances
Eq RelyingParty Source # | |
Defined in WebAuthn.Types | |
Ord RelyingParty Source # | |
Defined in WebAuthn.Types Methods compare :: RelyingParty -> RelyingParty -> Ordering # (<) :: RelyingParty -> RelyingParty -> Bool # (<=) :: RelyingParty -> RelyingParty -> Bool # (>) :: RelyingParty -> RelyingParty -> Bool # (>=) :: RelyingParty -> RelyingParty -> Bool # max :: RelyingParty -> RelyingParty -> RelyingParty # min :: RelyingParty -> RelyingParty -> RelyingParty # | |
Show RelyingParty Source # | |
Defined in WebAuthn.Types Methods showsPrec :: Int -> RelyingParty -> ShowS # show :: RelyingParty -> String # showList :: [RelyingParty] -> ShowS # |
- 4.3. User Account Parameters for Credential Generation
Constructors
User | |
Fields
|
Instances
Eq User Source # | |
Show User Source # | |
Generic User Source # | |
Serialise User Source # | |
type Rep User Source # | |
Defined in WebAuthn.Types type Rep User = D1 (MetaData "User" "WebAuthn.Types" "webauthn-0-D7kkv1m3eu7AMrO2q5jdsU" False) (C1 (MetaCons "User" PrefixI True) (S1 (MetaSel (Just "userId") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 ByteString) :*: S1 (MetaSel (Just "userDisplayName") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 Text))) |
- 1. Cryptographic Challenges
Constructors
Challenge | |
Fields |
Instances
Eq Challenge Source # | |
Ord Challenge Source # | |
Show Challenge Source # | |
Hashable Challenge Source # | |
Defined in WebAuthn.Types | |
ToJSON Challenge Source # | |
Defined in WebAuthn.Types | |
FromJSON Challenge Source # | |
Serialise Challenge Source # | |
data WebAuthnType Source #
Instances
Eq WebAuthnType Source # | |
Defined in WebAuthn.Types | |
Ord WebAuthnType Source # | |
Defined in WebAuthn.Types Methods compare :: WebAuthnType -> WebAuthnType -> Ordering # (<) :: WebAuthnType -> WebAuthnType -> Bool # (<=) :: WebAuthnType -> WebAuthnType -> Bool # (>) :: WebAuthnType -> WebAuthnType -> Bool # (>=) :: WebAuthnType -> WebAuthnType -> Bool # max :: WebAuthnType -> WebAuthnType -> WebAuthnType # min :: WebAuthnType -> WebAuthnType -> WebAuthnType # | |
Show WebAuthnType Source # | |
Defined in WebAuthn.Types Methods showsPrec :: Int -> WebAuthnType -> ShowS # show :: WebAuthnType -> String # showList :: [WebAuthnType] -> ShowS # | |
FromJSON WebAuthnType Source # | |
Defined in WebAuthn.Types |
data CollectedClientData Source #
- 10.1. Client Data Used in WebAuthn Signatures (dictionary CollectedClientData)
Constructors
CollectedClientData | |
Fields |
Instances
FromJSON CollectedClientData Source # | |
Defined in WebAuthn.Types Methods parseJSON :: Value -> Parser CollectedClientData # parseJSONList :: Value -> Parser [CollectedClientData] # |
data AttestedCredentialData Source #
- 4.1. Attested Credential Data
Constructors
AttestedCredentialData | |
Fields |
Instances
AAGUID of the authenticator
Constructors
AAGUID | |
Fields |
newtype CredentialPublicKey Source #
credential public key encoded in COSE_Key format
Constructors
CredentialPublicKey | |
Fields |
Instances
newtype CredentialId Source #
A probabilistically-unique byte sequence identifying a public key credential source and its authentication assertions.
Constructors
CredentialId | |
Fields |
Instances
Eq CredentialId Source # | |
Defined in WebAuthn.Types | |
Show CredentialId Source # | |
Defined in WebAuthn.Types Methods showsPrec :: Int -> CredentialId -> ShowS # show :: CredentialId -> String # showList :: [CredentialId] -> ShowS # | |
Hashable CredentialId Source # | |
Defined in WebAuthn.Types | |
ToJSON CredentialId Source # | |
Defined in WebAuthn.Types Methods toJSON :: CredentialId -> Value # toEncoding :: CredentialId -> Encoding # toJSONList :: [CredentialId] -> Value # toEncodingList :: [CredentialId] -> Encoding # | |
FromJSON CredentialId Source # | |
Defined in WebAuthn.Types | |
Serialise CredentialId Source # | |
Defined in WebAuthn.Types Methods encode :: CredentialId -> Encoding # decode :: Decoder s CredentialId # encodeList :: [CredentialId] -> Encoding # decodeList :: Decoder s [CredentialId] # |
verfication
data VerificationFailure Source #
Constructors
Instances
Show VerificationFailure Source # | |
Defined in WebAuthn.Types Methods showsPrec :: Int -> VerificationFailure -> ShowS # show :: VerificationFailure -> String # showList :: [VerificationFailure] -> ShowS # |
Arguments
:: Challenge | |
-> RelyingParty | |
-> Maybe Text | Token Binding ID in base64 |
-> Bool | require user verification? |
-> ByteString | clientDataJSON |
-> ByteString | attestationObject |
-> Either VerificationFailure AttestedCredentialData |
- 1. Registering a New Credential
Arguments
:: Challenge | |
-> RelyingParty | |
-> Maybe Text | Token Binding ID in base64 |
-> Bool | require user verification? |
-> ByteString | clientDataJSON |
-> ByteString | authenticatorData |
-> ByteString | signature |
-> CredentialPublicKey | public key |
-> Either VerificationFailure () |
- 2. Verifying an Authentication Assertion