Crate cf_access

Source
Expand description

§cf-access

Simple Cloudflare Access JWT validator.

§Usage

You will need:

  • Your team name
  • Your application’s AUD tag
use cf_access::Validator;

let validator = Validator::new("team_name", "aud_tag");

if let Some(jwt) = headers.get("cf-access-jwt-assertion") {
    if let Ok(claims) = validator.validate(jwt).await {
        println!("{claims:?}");
    }
}

§License

MIT

Re-exports§

pub use jwtk;
pub use reqwest;

Structs§

Validator
A validator for Cloudflare Access JWTs.

Enums§

Error
An error that can occur when validating a JWT or constructing a Validator.
Token
The user information found in the JWT.