Skip to main content

authenticate

Function authenticate 

Source
pub async fn authenticate(
    request: &Incoming<'_>,
    resource: &str,
    accept: &[TokenKind],
    options: &VerifyOptions,
    resolver: &dyn KeyResolver,
) -> Result<Authenticated>
Expand description

Verify a request’s signature, then the token it presents in Signature-Key, as one of the accepted kinds, for resource (this server’s own identifier). What a resource does with every request.

Only the jwt scheme is accepted, and resolver is consulted only for the token’s issuer: a jwks_uri signature, which would have this server fetch whatever the unauthenticated caller names, is refused without a fetch. Verify other schemes with httpsig::verify directly.