With the upcoming release of Vert.x 3.3 securing your application with Keycloak is even easier than before.

About Keycloak

Keycloak describes itself as an Open Source Identity and Access Management For Modern Applications and Services.

With Keycloak you can quickly add Authentication and Authorization to your vert.x application. The easy way is to setup a realm on keycloak and once you’re done, export the configuration to your vert.x app.

This how you would secure your app:

create a OAuth2Auth instance with OAuth2Auth.createKeycloak(...) copy your config from the keycloak admin GUI setup your callback according to what you entered on keycloak secure your resource with router.route("/protected/*").handler(oauth2)

Screencast

The following screencast explains how you can do this from scratch:

Don’t forget to follow our youtube channel!