You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何修复Keycloak与Firebase间的无效JWT问题?

Keycloak JWT作为Firebase自定义令牌验证失败问题分析

我最近搭建了Keycloak单点登录(SSO)系统,打算用它实现Firebase的SSO登录,结果碰到了个棘手的问题:Keycloak返回的JWT在Firebase中验证始终无效,但通过jwt.io校验时,这个JWT本身是完全正常的。

涉及的代码片段

authentificationService.js

getToken () {
    console.log(this.keycloakInstance.idToken)
    return this.keycloakInstance.idToken
}

main.js

firebase.auth.signInWithCustomToken(authentificationService.getToken())

这个问题在Firebase JS SDK的社区讨论中也有相关案例可以参考。

内容的提问来源于stack exchange,提问作者Gru

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.14 06:26:36