Hello dear Community,
I made a first draft of what could be a pac4j binding for Undertow. You can find our standard demo application here
https://github.com/pac4j/undertow-pac4j-demo. You can test several different authentication providers (facebook, twitter, form, CAS, SAML...).
I'd like to share some implementation details with you:
- I implemented a new AuthenticationMechanism delegating the authentication to a pac4j client; so this mechanism is rather "generic" in regards to what you got in undertow (one for basic auth, one for form...)
- pac4j needs a session mechanism so I used the Undertow SessionManager to store some attributes but also the User Profile once the user is successfully authenticated
- pac4j also needs a callback url to finish the authentication process so I developped a dedicated handler
- finally I used the EagerFormParsingHandler to grab the required POSTed data
To conclude I have to say I really appreciated the maturity of the framework because it was pretty straightforward to play with all the concepts and the ability to change from the IO thread to the dispatcher is really powerfull.
Jérôme and I are really interrested to get your feedback on this work. Does this binding makes sense to you? How can we improve this work to fit perfectly in Undertow and how can we extract a viable library from the demo?
Thank you for your help,
Regards,
Michaël