| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Firebase.Auth.Internal
Contents
Description
Primitives shared by the JWT verifier and the WAI and Servant integrations. Everything here is pure and depends only on the wire formats, never on the authentication types, so each layer can use it without pulling in the others.
Synopsis
Base64url
padBase64Url :: ByteString -> ByteString Source #
Restore the padding that JWT and JWK strip from their base64url payloads.
>>>padBase64Url "YWJjZA""YWJjZA=="
Bearer tokens
bearerToken :: RequestHeaders -> Maybe ByteString Source #
Extract a bearer token from a request's headers.
Takes the header list rather than a request so that both the WAI and the Servant integrations can share it without either becoming a dependency of the other.
stripBearerPrefix :: ByteString -> Maybe ByteString Source #
Strip the "Bearer " prefix from an Authorization header value.
The scheme name is matched case-insensitively, as RFC 7235 requires; the credentials that follow are returned verbatim.
>>>stripBearerPrefix "bearer abc.def.ghi"Just "abc.def.ghi"
bearerChallenge :: ByteString Source #
The challenge a 401 response carries in its WWW-Authenticate header,
naming the scheme the request should have used, as RFC 6750 requires.