Wednesday, December 29, 2021

[SOLVED] How to push claims to keycloak?

Issue

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");
    });


Answered By - Sriram Gunaseelan