pfzetto / axum-oidc

A OpenID Connect Client Libary for axum
https://crates.io/crates/axum-oidc
22 stars 7 forks source link

Adding an easy to understand example setup for keycloak #9

Closed corgijan closed 6 months ago

corgijan commented 6 months ago

I'm adding an easy to set up example deployment of keycloak to get up and running with testing the crate itself as well as applications using that crate.

Disclaimer: Please take a look at the logout @pfzetto I'm not getting logged out correctly. (Haven't Investigated any further)

corgijan commented 6 months ago

I will sign my commits ASAP (When I learned how that is done), would be glad for your feedback nonetheless regarding the logout.

pfzetto commented 6 months ago

Thanks, I think that I have found the logout error (see #10). Your PR looks good but I will investigate if the keycloak example can be used for End-to-End testing before merging it.

corgijan commented 6 months ago

What a nice idea ! I will check if you can automate the setup of keycloak in some way... Thanks for your support

pfzetto commented 6 months ago

Hey, I've just fiddled around using testcontainers and pushed it on integration-test. It is a fairly hacky but working implementation.

corgijan commented 6 months ago

Do you think it is still useful to add the compose file. I would have loved to have something like that when I was getting started with oidc... ?

P.S. The tests look so much more elegant than I thought was possible ! Nice work

pfzetto commented 6 months ago

I think that instructions/documentation in form of a README.md would be nice. I think that we should link to the Keycloak documentation where possible to reduce the maintenance work in this repo on a new keycloak version. Instead of a docker-compose we could modify the test setup to be executable with a feature flag or a binary target. This way the demo will work when the test runs successful and the keycloak is automatically setup.

pfzetto commented 6 months ago

I've now merged the integration-test branch with master and added a README.md to the example. Feel free to reopen the PR if you have additional changes.

Paul