开发者社区 问答 正文

有人在ios下测试osc的openapi的oauth2登录吗?报错

通过http://github.com/nxtbgthng/OAuth2Client进行oauth2登录测试,执行/action/openapi/token获取access_token报错:

Error: {"error":"500","error_description":"java.lang.String cannot be cast to [Ljava.lang.String;"}

暂时通过safria浏览器登录授权,再返回处理的,parameters参数如下:

    "client_id" = kCo4cf9mL4dE8ZhDv8GC;
    "client_secret" = gkdPurdXB8HNbqGge2vC8fdD2V1vCjdm;
    code = vKAFTt;
    "grant_type" = "authorization_code";
    "redirect_uri" = "jimneylee://oschina.com";

请路过的同学帮忙看下问题,谢谢。

展开
收起
爱吃鱼的程序员 2020-06-22 11:17:01 567 分享 版权
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    @oscfox检查下这个问题

    我用你以上提供的参数请求oschina得到结果:

    {"expires_in":43200,"token_type":"bearer","refresh_token":"4ef21616-1cf7-40e6-b4fd-014f69f2c304","access_token":"240a1aa3-2936-44aa-9566-cecfccd19b86"}
    建议检查以上参数的形式是否对了,像你上面给出的参数有的有引号有的没,我也不熟悉移动端怎么发请求的。。。
    2020-06-22 11:17:20
    赞同 展开评论