Giter VIP home page Giter VIP logo

Comments (3)

pmlopes avatar pmlopes commented on July 17, 2024

The current JWT impl can handle the KeyCloak tokens if you use it like:

JsonObject config = new JsonObject().put("public-key", "BASE64-ENCODED-PUBLIC_KEY");
AuthProvider provider = JWTAuth.create(vertx, config);

The main problem now is to tell the JWT where to look for the roles. In the default implementation if looks for a json object hash, while on KeyCloak the token has a top level set of hashes:

  • realm_access

  • resource_access

    and inside these then there are the roles.

Once way to "fix" could be where this is used:

https://github.com/vert-x3/vertx-auth/blob/master/vertx-auth-jwt/src/main/java/io/vertx/ext/auth/jwt/JWTOptions.java#L190

Then instead of assuming a direct key parse it as a path, say:

access_token/realm_access/roles

However this would give you the basic roles it does not do the extra KeyCloak specific validations such as realm name.

from vertx-auth.

paulbakker avatar paulbakker commented on July 17, 2024

Took a while to get back to this issue (holidays), but I just created a PR.

from vertx-auth.

paulbakker avatar paulbakker commented on July 17, 2024

I guess this issue can be closed now after the merge?

from vertx-auth.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.