Search code examples
javaspring-bootsingle-sign-onredhatkeycloak

How to push claims to keycloak?


I want to send few params from the spring boot application to the keycloak console for evaluating the policies. I want to send it from the application.properties.If possible,then how do i get it in the keycloak in policies for evaluation?

Thank You


Solution

  • This is how we send claims.

    app.get('/leads/reassign',keycloak.enforcer(['leads:reassign'],{
        claims: function(request){
        return {
            "location":["chennai"]
        }
        }
        } ), function (req, res) {
            res.send("granted");
        });