Regarding saving Session with the User: In order to support only 1 user's login (session) at any given time (no allow log in from more than 1 device) you need to manage relationship between the last log in session and the user. With such implementation session (ID) must be persisted to wherever user is persisted to (presumably DB).
Another thing - examples tell to use FormLoginHandler:
router.route("/login").handler(FormLoginHandler.create(authProvider));
I am using Jquery AJAX POSTs to send form content to Vert.x:
$.ajax({
type: "POST",
data: dataString,
success: function () {
...
FormLoginHandler fails to parse content of such a request. The only way that worked for me to process this request was to implement a custom handler that expects for "application/x-www-form-urlencoded" Content-Type.
So for me the flow: CookieHandler -> BodyHandler -> SessionHandler -> UserSessionHandler -> FormLoginHandler -> RedirectAuthHandler is not working.
Moreover, it's completely not clear how other Handler that receive AuthProvider in their constructors, work with the AuthProvider. I.e.:
UserSessionHandler.create(authProvider)
What the UserSessionHandler does with AuthProvider? How it calls it? UserSessionHandler's interface doesn't expose a method to retrieve the AuthProvider implementation and to work with it...