lejianwen / rustdesk-api

Custom Rustdesk Api Server, include web admin ,web client and oidc login
196 stars 53 forks source link

更新245版本后Google Oauth似乎没有迁移成功 #51

Closed Ogannesson closed 1 week ago

Ogannesson commented 1 week ago

更新245版本后使用Google Oauth时出现了 failed to fetch OlDC configuration image 日志为 2024-11-05 10:47:31 [WARN] LocalizeMessage Error: message "failed to fetch OIDC configuration" not found in language "zh-CN" (/home/runner/work/rustdesk-api/rustdesk-api/http/response/response.go:64 Gwen/http/response.TranslateMsg) GitHub登录正常

lejianwen commented 1 week ago

啊,我再测下试试

lejianwen commented 1 week ago

是不是访问google失败了?

Ogannesson commented 1 week ago

是不是访问google失败了?

应该不是,我这是走了代理的,等我把sqlite拉下来看看表吧。

lejianwen commented 1 week ago

我试了不走代理就会这样 嗯,先看看数据是啥样的 麻烦了

Ogannesson commented 1 week ago

我暂时没看出数据库有什么问题,但问题应该不在网络上,尝试Github登录的请求是成功走代理完成了的。

lejianwen commented 1 week ago

关掉代理之后我的也会这样 image image

lejianwen commented 1 week ago

image google这个数据有issuer吗?

Ogannesson commented 1 week ago

引用到新

没有

Ogannesson commented 1 week ago

问题似乎就在issuer,配置Google时没有填写issuer,但GetOauthConfig方法在 case model.OauthTypeOidc, model.OauthTypeGoogle 分支中调用 FetchOidcEndpoint()。如果 issuer 无效或无法正确解析就会抛出failed to fetch OIDC configuration

lejianwen commented 1 week ago

可以截图看下数据是什么样的吗?非常感谢!clientid之类的打码

lejianwen commented 1 week ago

嗯,但我迁移的时候应该写入了issuer

Ogannesson commented 1 week ago

其余项应该没什么问题,但issuer是空的 屏幕截图 2024-11-05 204748

Ogannesson commented 1 week ago

我看了一下迁移代码,很奇怪的是其余迁移都正常完成了,versions表也正常更新了,但issuser字段还是空的 image

lejianwen commented 1 week ago

我知道了,原来的issuer不是空是null,因为我sql是update oauths set issuer = 'https://accounts.google.com' where op = 'google' and issuer = '', 我改下,把issuer=''去掉

Ogannesson commented 1 week ago

我知道了,原来的issuer不是空是null,因为我sql是update oauths set issuer = 'https://accounts.google.com' where op = 'google' and issuer = '', 我改下,把issuer=''去掉 原来如此,我拿备份试验了几次,一直不行,我还纳闷来着

lejianwen commented 1 week ago

我也是用备份实验,因为我的备份数据之前一直是空置... 蛋疼

lejianwen commented 1 week ago

谢谢大佬的帮助

Ogannesson commented 1 week ago

没事,你也辛苦了

lejianwen commented 1 week ago

我更新了,246,你更新下试试

Ogannesson commented 1 week ago

我拿备份试了一下,OK了

lejianwen commented 1 week ago

好,多谢