https://github.com/gw31415/oidc_verify
A simple-usage OIDC-RS256 token verifier
https://github.com/gw31415/oidc_verify
jwt oidc rust
Last synced: 5 months ago
JSON representation
A simple-usage OIDC-RS256 token verifier
- Host: GitHub
- URL: https://github.com/gw31415/oidc_verify
- Owner: gw31415
- License: apache-2.0
- Created: 2024-08-24T02:10:36.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-26T03:24:54.000Z (almost 2 years ago)
- Last Synced: 2025-09-16T17:04:40.784Z (9 months ago)
- Topics: jwt, oidc, rust
- Language: Rust
- Homepage:
- Size: 40 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# oidc_verify
[](https://crates.io/crates/oidc_verify)
[](https://crates.io/crates/oidc_verify)
[](LICENSE)
This is a simple library to verify the JWT token of RS256 received from the OIDC provider.
It works without `authorization_endpoint` field, such as Firebase Auth.
## Dependencies
This library depends on `tokio` as an async runtime, so **your project should select `tokio`
as an async runtime too**.
## Usage
```rust
use oidc_verify::prelude::*;
use serde_json::Value;
#[tokio::main]
async fn main() {
let verifier = Verifier::new("https://securetoken.google.com/hogehoge-fugafuga/");
let token = "Bearer 3x4mple.t0k3n".strip_prefix("Bearer ").unwrap();
match verifier.verify::(token).await {
Ok(claims) => {
println!("Claims: {}", serde_json::to_string_pretty(&claims).unwrap());
},
Err(err) => {
println!("Error: {:?}", err);
},
}
}
````
## License
Apache 2.0