{"repo":"Keats/jsonwebtoken","free":true,"listed":false,"github":"https://github.com/Keats/jsonwebtoken","clone":"git clone https://github.com/Keats/jsonwebtoken.git","description":"JWT lib in rust","language":"Rust","stars":2086,"topics":["jwt","rust","jsonwebtoken"],"license":"MIT","category":"auth-billing-email","readme_excerpt":"jsonwebtoken API documentation on docs.rs See JSON Web Tokens for more information on what JSON Web Tokens are. Installation Add the following to Cargo.toml: Two crypto backends are available via features, aws lc rs and rust crypto , at most one of which must be enabled. If you select neither feature, you need to provide your own CryptoProvider . For examples of how to implement a CryptoProvider , see - arckoor/jsonwebtoken-providers The minimum required Rust version (MSRV) is specified in the rust-version field in this project's Cargo.toml. Algorithms This library currently supports the following: - HS256 - HS384 - HS512 - RS256 - RS384 - RS512 - PS256 - PS384 - PS512 - ES256 - ES384 - EdDSA How to use Complete examples are available in the examples directory: a basic one and one with a custom header. In terms of imports and structs: Claims The claims fields which can be validated. (see validation) Header The default algorithm is HS256, which uses a shared secret. Custom headers & changing algorithm All the parameters from the RFC are supported but the default header only has typ and alg set. If you want to set the kid parameter or change the algorithm for example: Look at examples/custom header.rs for a full working example. Encoding Encoding a JWT takes 3 parameters: - a header: the Header struct - some claims: your own struct - a key/secret When using HS256, HS384, or HS512, the key is always a shared secret like in the example above. When using RSA/EC, the key should alw","default_branch":null,"files":null,"tree":[],"storefront":"/r/Keats","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/Keats/jsonwebtoken/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}