For most usage, setting values in the builder object is enough to provide all the information you would like set in a JWT token. However, if some information is dynamic, meaning it is only known at the time the token is created, then you can provide this during the builder callback on the jwt_t object.
When verifying a token, the checker callback should not modify the jwt_t object at all. Access to the jwt_t is provided only to allow additional validation beyond LibJWT's internal checks.
◆ jwt_callback_t
General callback for generation and verification of JWT.
◆ jwt_t
Opaque JWT object.
Used in callbacks when generating or verifying a JWT
◆ jwt_claim_del()
Delete a value from the claims of a JWT.
- Parameters
-
jwt | Pointer to a jwt_t token, previously created with jwt_create() |
claim | The name of the claim to delete, or NULL to clear all claims |
- Returns
- A jwt_value_error_t value, JWT_VALUE_ERR_NONE being success.
◆ jwt_claim_get()
Get a value from the claims of a JWT.
- Parameters
-
jwt | Pointer to a jwt_t token, previously created with jwt_create() |
value | A jwt_value_t structure with relevant actions filled in |
- Returns
- A jwt_value_error_t value, JWT_VALUE_ERR_NONE being success. The value.error field will match this return value.
◆ jwt_claim_set()
Set a value in the claims of a JWT.
- Parameters
-
jwt | Pointer to a jwt_t token, previously created with jwt_create() |
value | A jwt_value_t structure with relevant actions filled in |
- Returns
- A jwt_value_error_t value, JWT_VALUE_ERR_NONE being success. The value.error field will match this return value.
◆ jwt_header_del()
Delete a value from the header of a JWT.
- Parameters
-
jwt | Pointer to a jwt_t token, previously created with jwt_create() |
header | The name of the header to delete, or NULL to clear the entire header |
- Returns
- A jwt_value_error_t value, JWT_VALUE_ERR_NONE being success.
◆ jwt_header_get()
Get a value from the header of a JWT.
- Parameters
-
jwt | Pointer to a jwt_t token, previously created with jwt_create() |
value | A jwt_value_t structure with relevant actions filled in |
- Returns
- A jwt_value_error_t value, JWT_VALUE_ERR_NONE being success. The value.error field will match this return value.
◆ jwt_header_set()
Set a value in the header of a JWT.
- Parameters
-
jwt | Pointer to a jwt_t token, previously created with jwt_create() |
value | A jwt_value_t structure with relevant actions filled in |
- Returns
- A jwt_value_error_t value, JWT_VALUE_ERR_NONE being success. The value.error field will match this return value.