Last active
October 4, 2025 17:31
-
-
Save daniel-shuy/62ef61a3e64bd1764931a8d3dda36e3e to your computer and use it in GitHub Desktop.
Akka HTTP (Scala) Keycloak token verifier
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
| val akkaVersion = "2.5.23" | |
| val akkaHttpVersion = "10.1.8" | |
| val keycloakVersion = "6.0.1" | |
| libraryDependencies ++= Seq( | |
| "com.typesafe.akka" %% "akka-http" % akkaHttpVersion, | |
| "com.typesafe.akka" %% "akka-stream" % akkaVersion, | |
| "org.keycloak" % "keycloak-adapter-core" % keycloakVersion, | |
| "org.keycloak" % "keycloak-core" % keycloakVersion, | |
| ) |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@el-dom The blocking call can be wrapped in a
Futureto run on a separate dispatcher from the Akka HTTP routing dispatcher. I've updated this Gist to run it on a new dispatcher calledauth-dispatcher, which needs to be configured inapplication.conf(see https://doc.akka.io/docs/akka-http/current/handling-blocking-operations-in-akka-http-routes.html#solution-dedicated-dispatcher-for-blocking-operations).