title: What is the proper way to register policy-enforcer configuration in ktor
body: <p>In spring boot, adding keycloak adaptor and &quot;keycloak.policy-enforcer-config.claimInformationPointConfig.claims[claim-from-uri]={ request.uri }&quot; to application.properties
  file, I am able to receive &quot;claim-from-uri&quot; in keycloak javascript policy. But using similar settings in ktor does not work.</p>
  <p>I have added &quot;policy-enforcer&quot; to keyclaok.json but &quot;claim-from-uri&quot; property is always null in javascript policy in keycloak.</p>
  <pre><code>// js policy in keycloak
  var context = $evaluation.getContext();
  var attributes = context.getAttributes();
  var realm = $evaluation.getRealm();
  var httpUri = attributes.getValue('http.uri');
  var claimFromUri = attributes.getValue('claim-from-uri');
  </code></pre>
  <p>My usecase is to get the claim from the URI and then use it to get the policy from the keycloak server.</p>
  <p>Below is my keycloak.json file.</p>
  <pre><code>{
    &quot;realm&quot;: &quot;test-realm&quot;,
    &quot;auth-server-url&quot;: &quot;https://localhost:8080/auth&quot;,
    &quot;ssl-required&quot;: &quot;none&quot;,
    &quot;resource&quot;: &quot;api-resource&quot;,
    &quot;public-client&quot;: true,
    &quot;policy-enforcer&quot;: {
      &quot;enforcement-mode&quot;: &quot;ENFORCING&quot;,
      &quot;paths&quot;: [
        {
          &quot;path&quot;: &quot;/api/*&quot;,
          &quot;claim-information-point&quot;: {
            &quot;claims&quot;: {
              &quot;claim-from-uri&quot;: &quot;{request.uri}&quot;
            }
          },
          &quot;methods&quot;: [
            {
              &quot;method&quot;: &quot;GET&quot;,
              &quot;scopes&quot;: [&quot;get&quot;, &quot;GET&quot;]
            },
            {
              &quot;method&quot;: &quot;POST&quot;,
              &quot;scopes&quot;: [&quot;post&quot;, &quot;POST&quot;]
            }
          ]
        }
      ]
    }
  }
  
  
  </code></pre>
  <pre><code>val keycloakProvider = OAuthServerSettings.OAuth2ServerSettings(
      name = &quot;keycloak&quot;,
      authorizeUrl = &quot;https://localhost:8082/auth/realms/test-realm/protocol/openid-connect/auth&quot;,
      accessTokenUrl = &quot;https://localhost:8082/auth/realms/test-realm/protocol/openid-connect/token&quot;,
      clientId = &quot;test-realm-backend&quot;,
      clientSecret = &quot;client-secret&quot;,
      accessTokenRequiresBasicAuth = false,
      requestMethod = HttpMethod.Post,
      )
  
  //application setup
      install(Authentication) {
              oauth(&quot;keycloak&quot;) {
                  client = HttpClient(Apache)
                  providerLookup = { keycloakProvider }
                  urlProvider = { &quot;http://localhost:8080/callback&quot; }
              }
          }
  
  // routing
        authenticate(&quot;keycloak&quot;) {
          get(&quot;/api/{name}&quot;) {
            val principal: OAuthAccessTokenResponse.OAuth2? = call.authentication.principal()
            call.sessions.set(UserSession(&quot;Bearer $principal?.accessToken.toString()&quot;))
            val name = call.parameters[&quot;name&quot;] ?: &quot;name missing in parameter&quot;
            val user = User(name)
            call.respond(user)
  
        }
    }
  </code></pre>