Vertx 3 and Keycloak tutorial

With the up­com­ing re­lease of Vert.x 3.3 se­cur­ing your ap­pli­ca­tion with Key­cloak is even eas­ier than be­fore.

About Keycloak

Key­cloak de­scribes it­self as an Open Source Iden­tity and Ac­cess Man­age­ment For Mod­ern Ap­pli­ca­tions and Ser­vices.

With Key­cloak you can quickly add Au­then­ti­ca­tion and Au­tho­riza­tion to your vert.x ap­pli­ca­tion. The easy way is to setup a realm on key­cloak and once you’re done, ex­port the con­fig­u­ra­tion to your vert.x app.

This how you would se­cure your app:

  1. cre­ate a OAuth2Auth in­stance with OAuth2Auth.createKeycloak(...)
  2. copy your con­fig from the key­cloak admin GUI
  3. setup your call­back ac­cord­ing to what you en­tered on key­cloak
  4. se­cure your re­source with router.route("/protected/*").handler(oauth2)

Screencast

The fol­low­ing screen­cast ex­plains how you can do this from scratch:

Don’t for­get to fol­low our youtube chan­nel!

Next post

Vert.x 3.3.0 is released!

That was a long run … but here we are. We are very pleased to announce the release of Vert.x 3.3.0!

Read more
Previous post

Vert.x 3 and Azure cloud platform tutorial

Vert.x 3.2.1 applications can quickly be deployed on Microsoft Azure. Deployment is independent of your build so it is all about configuration.

Read more
Related posts

JWT Authorization for Vert.x with Keycloak

In this blog post, you'll learn about JWT foundations, protect routes with JWT Authorization, JWT encoded tokens, and RBAC with Keycloak

Read more

Easy SSO for Vert.x with Keycloak

In this blog post, you'll learn how to implement Single Sign-on with OpenID Connect and how to use Keycloak together with Eclipse Vert.x.

Read more

Unit and Integration Tests

Let’s refresh our mind about what we developed so far in the introduction to vert.x series. We forgot an important task. We didn’t test the API.

Read more