Crates.io | tower-oauth2-resource-server |
lib.rs | tower-oauth2-resource-server |
version | |
source | src |
created_at | 2024-11-07 20:44:52.713795 |
updated_at | 2024-12-10 16:36:40.755548 |
description | Tower middleware that provides JWT authorization against an OpenID Connect (OIDC) Provider |
homepage | https://github.com/Dunklas/tower-oauth2-resource-server |
repository | https://github.com/Dunklas/tower-oauth2-resource-server |
max_upload_size | |
id | 1440162 |
Cargo.toml error: | TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
Tower middleware that provides JWT authorization against an OpenID Connect (OIDC) Provider. This is useful when an application has delegated authentication and/or authorization to an external authorization service (e.g. Auth0, Microsoft Entra, etc).
Main inspiration for this middleware (both in naming and functionality) is Spring Security OAuth 2.0 Resource Server.
The middleware will attempt to process each request by:
Authorization
header (with Bearer
prefix)jwks_url
iss
, exp
, aud
and possibly nbf
scopes of the JWTIf validation fails, a HTTP 401 is returned. Otherwise next service in the middleware chain will be called. Claims of the JWT are made available as a Request extension. This enables you to write further application logic based on the claims, e.g. rejecting request that lack a certain scope.
See docs for OAuth2ResourceServerBuilder.
Check the examples.