When Cloudflare sends a request to your origin, the request will include an application token as a Cf-Access-Jwt-Assertion request header and as a CF_Authorization cookie.
Cloudflare signs the token with a key pair unique to your account. You should validate the token with your public key to ensure that the request came from Access and not a malicious third party.
Access signing keys
The public key for the signing key pair is located at https://<your-team-name>.cloudflareaccess.com/cdn-cgi/access/certs, where <your-team-name> is your Zero Trust team name.
By default, Access rotates the signing key every 6 weeks. This means you will need to programmatically or manually update your keys as they rotate. Previous keys remain valid for 7 days after rotation to allow time for you to make the update.
You can also manually rotate the key using the API. This can be done for testing or security purposes.
As shown in the example below, https://<your-team-name>.cloudflareaccess.com/cdn-cgi/access/certs contains two public keys: the current key used to sign all new tokens, and the previous key that has been rotated out.
keys: both keys in JWK format
public_cert: current key in PEM format
public_certs: both keys in PEM format
Verify the JWT manually
To verify the token manually:
Copy the JWT from the CF_Authorization cookie or from the Cf-Access-Jwt-Assertion request header.
In the Payload box, ensure that the iss field points to your team domain (https://<your-team-name>.cloudflareaccess.com). jwt.io uses the iss value to fetch the public key for token validation.
Ensure that the page says Signature Verified.
You can now trust that this request was sent by Access.
Programmatic verification
You can run an automated script on your origin server to validate incoming requests. The provided sample code gets the application token from a request and checks its signature against your public key. You will need to insert your own team domain and Application Audience (AUD) tag into the sample code.
Get your AUD tag
Cloudflare Access assigns a unique AUD tag to each application. The aud claim in the token payload specifies which application the JWT is valid for.