A OpenID Connect Client Libary for axum
Go to file
Paul Zinselmeyer e62aba722c
feat: automated integration test for example/basic
Adds automated CI integration tests to the basic example.
The integration tests launch and configure a keycloak server, launch the
example and test its functionality with a headless browser.
2024-05-17 16:41:49 +02:00
.github/workflows feat: automated integration test for example/basic 2024-05-17 16:41:49 +02:00
examples/basic feat: automated integration test for example/basic 2024-05-17 16:41:49 +02:00
src feat: add additional constructors for `OidcClient` 2024-05-17 16:09:25 +02:00
.gitignore Added first implementation of RP Initiated Logout 2024-03-25 17:20:44 +01:00
Cargo.toml v0.4.0 & dependency update 2024-04-28 10:52:41 +02:00
README.md Add version structure to README.md 2024-04-18 16:13:57 +02:00


This Library allows using OpenID Connect with axum. It authenticates the user with the OpenID Conenct Issuer and provides Extractors.


The OidcAuthLayer must be loaded on any handler that might use the extractors. The user won't be automatically logged in using this layer. If a valid session is found, the extractors will return the correct value and fail otherwise.

The OidcLoginLayer should be loaded on any handler on which the user is supposed to be authenticated. The User will be redirected to the OpenId Conect Issuer to authenticate. The extractors will always return a value.

The OidcClaims-extractor can be used to get the OpenId Conenct Claims. The OidcAccessToken-extractor can be used to get the OpenId Connect Access Token.

The OidcRpInitializedLogout-extractor can be used to get the rp initialized logout uri.

Your OIDC-Client must be allowed to redirect to every subpath of your application base url.


Take a look at the examples folder for examples.

Older Versions

All versions on crates.io are available as git tags. Additonal all minor versions have their own branch (format vX.Y where X is the major and Y is the minor version) where bug fixes are implemented. Examples for each version can be found there in the previously mentioned examples folder.


I'm happy about any contribution in any form. Feel free to submit feature requests and bug reports using a GitHub Issue. PR's are also appreciated.


This Library is licensed under LGPLv3.