Skip to content

Commit 42e8ad0

Browse files
author
Dollyg
committed
Co-authored-by: Bilal Fazlani <[email protected]>
1 parent 56d98ad commit 42e8ad0

File tree

2 files changed

+3
-27
lines changed

2 files changed

+3
-27
lines changed

src/main/scala/tech/bilal/embedded_keycloak/EmbeddedKeycloak.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class EmbeddedKeycloak(keycloakData: KeycloakData,
2626

2727
val fileIO = new FileIO(settings)
2828

29-
def preRun(): Unit = {
29+
private def preRun(): Unit = {
3030
installer.install()
3131
ports.checkAvailability(port = port, throwOnError = true)
3232
}

src/main/scala/tech/bilal/embedded_keycloak/impl/data/AdminFeeder.scala

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -28,25 +28,12 @@ private[embedded_keycloak] class RestAdminFeeder(settings: Settings)
2828
with AdminFeeder {
2929

3030
override def feedAdminUser(admin: AdminUser): Unit = {
31-
val origin = s"http://${settings.host}:${settings.port}"
31+
val origin = s"http://localhost:${settings.port}"
3232
val referer = origin + "/"
3333
val url = referer + "auth/"
3434
val cookieName = "WELCOME_STATE_CHECKER"
3535

36-
val getResponse = get(
37-
url = url,
38-
headers = Map(
39-
"Connection" -> "keep-alive",
40-
"Pragma" -> "no-cache",
41-
"Cache-Control" -> "Cache-Control",
42-
"Upgrade-Insecure-Requests" -> "1",
43-
"User-Agent" -> "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36",
44-
"Accept" -> "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
45-
"Referer" -> referer,
46-
"Accept-Encoding" -> "gzip, deflate, br",
47-
"Accept-Language" -> "en-US,en;q=0.9"
48-
),
49-
)
36+
val getResponse = get(url = url)
5037

5138
if (getResponse.statusCode != 200)
5239
throw new RuntimeException("could not create admin user")
@@ -58,17 +45,6 @@ private[embedded_keycloak] class RestAdminFeeder(settings: Settings)
5845

5946
val postResponse = post(
6047
url = url,
61-
headers = Map(
62-
"Connection" -> "keep-alive",
63-
"Cache-Control" -> "max-age=0",
64-
"Origin" -> origin,
65-
"Upgrade-Insecure-Requests" -> "1",
66-
"Content-Type" -> "application/x-www-form-urlencoded",
67-
"User-Agent" -> "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36",
68-
"Accept" -> "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
69-
"Referer" -> url,
70-
"Accept-Language" -> "en-US,en;q=0.9,gl;q=0.8,de;q=0.7"
71-
),
7248
cookies = cookies,
7349
data = RequestBlob.FormEncodedRequestBlob(
7450
Map(

0 commit comments

Comments
 (0)