Class PolicyEnforcer


  • public class PolicyEnforcer
    extends Object

    A Policy Enforcement Point (PEP) that requests and enforces authorization decisions from Keycloak.

    Author:
    Pedro Igor
    • Method Detail

      • getHttpClient

        public org.apache.http.client.HttpClient getHttpClient()
      • getPaths

        public Map<String,​org.keycloak.representations.adapters.config.PolicyEnforcerConfig.PathConfig> getPaths()
      • isAuthorized

        protected boolean isAuthorized​(org.keycloak.representations.adapters.config.PolicyEnforcerConfig.PathConfig actualPathConfig,
                                       org.keycloak.representations.adapters.config.PolicyEnforcerConfig.MethodConfig methodConfig,
                                       org.keycloak.representations.AccessToken accessToken,
                                       HttpRequest request,
                                       Map<String,​List<String>> claims)
      • resolveClaims

        protected Map<String,​List<String>> resolveClaims​(org.keycloak.representations.adapters.config.PolicyEnforcerConfig.PathConfig pathConfig,
                                                               HttpRequest request)
      • challenge

        protected boolean challenge​(org.keycloak.representations.adapters.config.PolicyEnforcerConfig.PathConfig pathConfig,
                                    org.keycloak.representations.adapters.config.PolicyEnforcerConfig.MethodConfig methodConfig,
                                    HttpRequest request,
                                    HttpResponse response)
      • handleAccessDenied

        protected void handleAccessDenied​(HttpResponse response)