You need to enable JavaScript to run this app. 使用Laravel Passport为Freshdesk搭建OAuth2 SSO时遇到用户信息接口报错
优惠活动
大模型
产品
解决方案
定价
更多

使用Laravel Passport为Freshdesk搭建OAuth2 SSO时遇到用户信息接口报错

场景与前期基础工作
  • 核心业务目标:在Laravel 8.13站点与关联的Freshdesk支持门户搭建单点登录能力,让已登录自有站点的用户点击按钮即可无感知跳转登录Freshdesk,查看非公开文档、按需提交服务工单
  • 现有技术基础:已部署Laravel Passport 10.1,通过Postman测试可正常生成访问令牌
  • 已完成的对接尝试:
    • 先后选用Personal Access Client、Password Grant Client两种OAuth客户端类型配置,均触发完全相同的报错
    • 针对Freshdesk配置界面要求填写的“User info URL*”字段,先后测试3个地址,均未解决用户信息获取失败的问题,测试地址分别为:
      • http://testsite.ngrok.io/oauth/tokens
      • http://testsite.ngrok.io/oauth/personal-access-tokens
      • http://testsite.ngrok.io/api/user
  • 已开展的排查动作:
    • 检索Stack Overflow平台所有匹配的同类问题,未找到完全对应当前场景的解决方案
    • 向Freshdesk官方提交支持工单、参与线上支持沟通会,对方判定问题出在我方服务侧,无法提供进一步协助
    • 参考旧版技术文档提到的UserRepository.php中的getUserEntityByUserCredentials方法,在方法内添加日志打点,观测到Freshdesk发起的请求根本未触发该方法
核心报错信息

在向Freshdesk发起认证请求时,系统返回如下报错:

An error occurred while attempting to retrieve the userinfo resource: could not extract response: no 
suitable httpmessageconverter found for response type [java.util.map<java.lang.string, 
java.lang.object>] and content type [text/html;charset=utf-8]
现有接口返回验证情况
  • 直接在浏览器访问http://testsite.ngrok.io/oauth/personal-access-tokens,服务返回的JSON结构如下:
[{
    "id": "e595f342722c1045e061f2f026fa7f07181b3d5c69016e9999c5640f1e65928ff6fe2621565ff666c5",
    "user_id": 43128,
    "client_id": 7,
    "name": null,
    "scopes": "openid,email,profile",
    "revoked": false,
    "created_at": "2021-01-26 10:16:12",
    "updated_at": "2021-01-26 10:16:12",
    "expires_at": "2022-01-26T10:16:12.000000Z",
    "client": {
        "id": 7,
        "user_id": null,
        "name": "freshworksPersonalAccessClient",
        "provider": null,
        "redirect": "https://testsite.freshworks.com/sp/OAUTH/27402945223480041/callback",
        "personal_access_client": true,
        "password_client": false,
        "revoked": false,
        "created_at": "2021-01-19T23:19:39.000000Z",
        "updated_at": "2021-01-19T23:19:39.000000Z"
    }
}]
  • 当前存在的疑问:
    • 上述返回结构是否符合Freshdesk对用户信息接口的格式要求
    • Freshdesk对接OAuth SSO时需要的标准用户信息字段,需要在Laravel服务端按照什么返回格式、在哪个路由路径实现对应接口
实现约束要求
  • 优先在Laravel技术生态内完成对接,不借助ADFS、OneLogin、Okta、Azure这类第三方身份提供商,仅需实现Freshdesk的SSO能力即可

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.11.06 15:36:04