Hi all, I am trying to write a script mapper. I need to hit my Backend to verify some stuff. I am unable to do so. Is there any best solution to achieve such kind of thing??
var url = 'http://some-url.com';
fetch(url, {
method: "GET",
headers: {"Content-type": "application/json;charset=UTF-8"}
})
.then(response => {
var json = JSON.parse(response);
var temp = json.id;
});
I am trying this code but getting error while saving script.
Caused by: java.lang.ClassNotFoundException: java.net.http.HttpClient from [Module "org.keycloak.keycloak-services" version 15.0.2.redhat-00001 from local module loader
Getting this error while hitting the script mapper
java.net.http.HttpClient is included in Java 11 or newer. Are you running an older JDK?
I am using this in mappers and authenticators since 2 years (Keycloak 10+, always Ubuntu 18/20 with OpenJDK 11, always Keycloak Wildfly distribution, never used docker…)