Skip to content

Instantly share code, notes, and snippets.

@bandrzejczak
Created February 9, 2018 22:17
Show Gist options
  • Select an option

  • Save bandrzejczak/bc6fc7dd5adf0bd9ee2fdcc7bd3d7e3f to your computer and use it in GitHub Desktop.

Select an option

Save bandrzejczak/bc6fc7dd5adf0bd9ee2fdcc7bd3d7e3f to your computer and use it in GitHub Desktop.
class KeycloakTokenVerifier(keycloakDeployment: KeycloakDeployment) extends TokenVerifier {
implicit val executionContext = ExecutionContext.fromExecutor(new ForkJoinPool(2))
def verifyToken(token: String): Future[String] = {
Future {
RSATokenVerifier.verifyToken(
token,
keycloakDeployment.getRealmKey,
keycloakDeployment.getRealmInfoUrl
).getPreferredUsername
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment