#axum #openid-connect #oidc

axum-oidc

A wrapper for the openidconnect crate for axum

8 releases

0.3.0 Mar 10, 2024
0.2.3 Jan 23, 2024
0.2.1 Dec 19, 2023
0.1.2 Apr 18, 2024
0.0.0 Nov 2, 2023

#580 in Authentication

Download history 11/week @ 2024-01-15 14/week @ 2024-01-22 26/week @ 2024-02-19 17/week @ 2024-02-26 95/week @ 2024-03-04 89/week @ 2024-03-11 20/week @ 2024-03-25 29/week @ 2024-04-01 31/week @ 2024-04-08 83/week @ 2024-04-15

163 downloads per month

LGPL-3.0-or-later

30KB
628 lines

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

Usage

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.

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

Examples

Take a look at the examples folder for examples.

Contributing

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.

License

This Library is licensed under LGPLv3.

Dependencies

~19–36MB
~577K SLoC