javascript - QQ第三方登录问题

 mobiledu2502857577 发布于 2022-11-16 06:03
               
callbackUrl = window.location.origin + window.location.pathname + window.location.pathname;
 qq: {
    get_authorize_link: function(callbackUrl, state, isMobile) {
        var redirect_uri = callbackUrl;
        var link = 'https://graph.qq.com/oauth2.0/authorize?client_id=101285264';
        link += '&redirect_uri=' + encodeURIComponent(redirect_uri);
        link += '&scope=get_user_info';
        if (isMobile)
            link += '&display=mobile';
        if (state)
            link += '&state=' + state;
        link += '&response_type=code';
        return link;
    }
},

window.location.href = link;

返回的是:http://www.eyee.com/#/discovery?code=6928A4B9BB8BD037041E0AC1783F38B9&state=1460161958

怎么使用code 获得 Access Token
官方文档的不知道怎么使用?
有人可以详细说一下吗
我用的是angular + nodejs

1 个回答
  • 第一次做OAuth2.0的接入把?OAuth2.0的接入流程都是近似的,通过code换取access token是一个单独的接口。地址是: https://graph.qq.com/oauth2.0/token 参数在文档里说得很清楚吧:
    http://wiki.open.qq.com/wiki/website/%E4...

    2022-11-16 06:08 回答
撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有