Created
February 9, 2018 22:18
-
-
Save bandrzejczak/f9b2ea3d6d3b15b685ab73022c03f989 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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