Skip to content

Commit

Permalink
fixed the admin creation bug
Browse files Browse the repository at this point in the history
  • Loading branch information
bilal-fazlani committed Feb 6, 2019
1 parent ee7f71a commit 3710ef3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Expand Up @@ -28,7 +28,7 @@ private[embedded_keycloak] class RestAdminFeeder(settings: Settings)
with AdminFeeder {

override def feedAdminUser(admin: AdminUser): Unit = {
val origin = s"http://${settings.host}:${settings.port}"
val origin = s"http://localhost:${settings.port}"
val referer = origin + "/"
val url = referer + "auth/"
val cookieName = "WELCOME_STATE_CHECKER"
Expand Down Expand Up @@ -82,6 +82,8 @@ private[embedded_keycloak] class RestAdminFeeder(settings: Settings)

if (postResponse.statusCode != 200)
throw new RuntimeException("could not create admin user")
} else {
println("Admin user already exists. Skipped admin creation")
}
}
}
Expand Up @@ -2,8 +2,9 @@ package tech.bilal.embedded_keycloak.impl.data

import org.scalatest.{BeforeAndAfterAll, FunSuite, Matchers}
import tech.bilal.embedded_keycloak.KeycloakData.{ApplicationUser, ClientRole}
import tech.bilal.embedded_keycloak.utils.{BearerToken, Ports}
import tech.bilal.embedded_keycloak.utils.Ports
import tech.bilal.embedded_keycloak.{EmbeddedKeycloak, KeycloakData, Settings}

import scala.concurrent.Await
import scala.concurrent.ExecutionContext.Implicits._
import scala.concurrent.duration.DurationDouble
Expand All @@ -16,9 +17,6 @@ class DataFeederTest extends FunSuite with Matchers with BeforeAndAfterAll {
val keycloak = new EmbeddedKeycloak(keycloakData, settings)
val stopHandle = Await.result(keycloak.startServer(), 2.minutes)

implicit val bearerToken: BearerToken =
BearerToken.fromServer(9005, "admin", "admin")

val actualRealms =
KeycloakData.fromServer(settings, "admin", "admin").realms

Expand Down

0 comments on commit 3710ef3

Please sign in to comment.