You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use Axum's custom extractor to implement JWT authentication. I can print the contents of the State within the extractor, but I can't access it inside the extractor. Below is the JWT validation code I've written. Can you advise me on how to modify it to achieve the functionality I desire?
I have not yet found a solution that doesn't produce errors. The configuration of Cargo.toml is as follows, and the Rust compiler version I am using is rustc 1.76.0 (07dca489a 2024-02-04). I would appreciate it if someone could help me clear up this confusion, and any reply are welcome. Thanks.
[dependencies]
axum = "^0.7"tokio = { version = "^1.36", features = ["full"] }
tower-http = { version = "^0.5", features = ["trace"] }
tracing = "^0.1"tracing-subscriber = { version = "^0.3", features = ["env-filter"] }
serde = { version = "1.0", features = ["derive"] }
jsonwebtoken = "9.2.0"
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Summary
I'm trying to use Axum's custom extractor to implement JWT authentication. I can print the contents of the State within the extractor, but I can't access it inside the extractor. Below is the JWT validation code I've written. Can you advise me on how to modify it to achieve the functionality I desire?
I have not yet found a solution that doesn't produce errors. The configuration of
Cargo.toml
is as follows, and the Rust compiler version I am using is rustc 1.76.0 (07dca489a 2024-02-04). I would appreciate it if someone could help me clear up this confusion, and any reply are welcome. Thanks.axum version
0.7.4
Beta Was this translation helpful? Give feedback.
All reactions