scala - 如何使用 keycloak 保护 http4s webapp?
问题描述
我想用 Keycloak 保护我的基于 Http4s 的 webapp,这在https://www.keycloak.org/docs/latest/securing_apps/index.html#_jetty9_adapter中有描述。
如代码片段所示,http4s webapp 在 Jetty 上运行
object UserSvcServer {
def stream[F[_]: ConcurrentEffect](implicit T: Timer[F], C: ContextShift[F]): Stream[F, Nothing] = {
val helloWorldAlg = HelloWorld.impl[F]
val httpApp = (
UserSvcRoutes.helloWorldRoutes[F](helloWorldAlg)
).orNotFound
val finalHttpApp = Logger.httpApp(true, true)(httpApp)
for {
exitCode <- JettyBuilder[F]
.bindHttp(8080, "0.0.0.0")
.mountHttpApp(finalHttpApp, "/")
.serve
} yield exitCode
}.drain
}
而且我不必从https://www.eclipse.org/jetty/下载码头容器。
有没有办法使用 Keycloak 码头适配器保护基于 Http4s 的 webapp?
解决方案
推荐阅读
- python - Keras/Tensorflow 中的 input_shape 参数
- javascript - 传递两个参数时获取承诺错误
- javascript - 如何使用 React.js 构建可以从第三方软件(例如 Google 文档)获取博客文章的博客站点?
- python - 如何对 pandas 列值进行交叉验证?
- c# - 如何将 UTF-8 传递到 ContentType c#?
- c - C 程序说明(使用逗号运算符)
- python - 如何每天运行python脚本
- reactjs - 状态在反应中没有改变。它会在浏览器刷新后更改状态
- java - 如何根据查找插入表格
- powerbuilder - 我找不到附加到在数据窗口上创建的按钮的用户定义操作