Siva Thangaraj
Siva Thangaraj

Reputation: 224

Keycloak Policy Enforcing

Application.properties:

    server.port=8180
    keycloak.realm = finaltest
    keycloak.auth-server-url = http://localhost:8080/auth
    keycloak.resource = ex
    keycloak.public-client=false
    keycloak.enabled=true
    keycloak.credentials.secret=secret
    keycloak.ssl-required = external
    keycloak.cors=true
    keycloak.use-resource-role-mappings=true

    keycloak.security-constraints[0].auth-roles[0]=master
    keycloak.security-constraints[0].security-collections[0].patterns[0]=/*

    keycloak.policy-enforcer-config.enforcement-mode=ENFORCING

    keycloak.policy-enforcer-config.lazy-load-paths=true

RESOURCES: I have two resources namely http://localhost:8180/flights.html http://localhost:8180/hotels.html I have protected these using the policies in keycloak admin console.How do I enforce these policies in the application?

Upvotes: 4

Views: 3630

Answers (1)

Sindhu Arju
Sindhu Arju

Reputation: 438

keycloak.policy-enforcer-config.enforcement-mode=ENFORCING this line will enforce policies.But you must have spring boot version 2.0 and above.

Upvotes: 2

Related Questions