Skip to content

Instantly share code, notes, and snippets.

@bandrzejczak
Created February 9, 2018 22:18
Show Gist options
  • Save bandrzejczak/f9b2ea3d6d3b15b685ab73022c03f989 to your computer and use it in GitHub Desktop.
Save bandrzejczak/f9b2ea3d6d3b15b685ab73022c03f989 to your computer and use it in GitHub Desktop.
implicit val system = ActorSystem("sso-system")
implicit val actorMaterializer = ActorMaterializer()
val oauth2 = new OAuth2Authorization(
Logging(system, getClass),
new KeycloakTokenVerifier(
KeycloakDeploymentBuilder.build(
getClass.getResourceAsStream("/keycloak.json")
)
)
)
import oauth2._
val routes = authorized { token =>
path("test") {
get {
jsonpWithParameter("callback") {
complete(token)
}
}
}
}
Http().bindAndHandle(routes, "localhost", 9000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment