HTTP triggers and custom domain names of Function Compute support JWT authentication. You are not charged for invocations that fail the authentication. You can also use the JWT authentication plug-in of API Gateway for authentication.
For more information, see Configure JWT authentication for an HTTP trigger, Configure JWT authentication for custom domain names, and JWT authentication.