Structs§
- Auth
Error - Claims
- Current
User - Decoding
Context - Decoding
Key - All the different kind of keys we can use to decode a JWT. This key can be re-used so make sure you only initialize it once if you can for better performance.
- Encoding
Context - Encoding
Key - A key to encode a JWT with. Can be a secret, a PEM-encoded key or a DER-encoded key. This key can be re-used so make sure you only initialize it once if you can for better performance.
- Error
- An error that can occur when encoding/decoding JWTs
- Header
- A basic JWT header, the alg defaults to HS256 and typ is automatically
set to
JWT
. All the other fields are optional. - Login
Response - Refresh
Body - Request
Body - Validation
- Contains the various validations that are applied after decoding a JWT.
Enums§
- Algorithm
- The algorithms supported for signing/verifying JWTs
Traits§
- Deserialize
- A data structure that can be deserialized from any data format supported by Serde.
- Serialize
- A data structure that can be serialized into any data format supported by Serde.
- User
Data
Functions§
- auth_
token_ decode - auth_
token_ encode - decode
- Decode and validate a JWT
- encode
- Encode the header and claims given and sign the payload using the algorithm from the header and the key. If the algorithm given is RSA or EC, the key needs to be in the PEM format.
- login
- refresh_
token - verify_
user