maven的web工程QQ第三方登录HTML、

声明、使用JDK9、idea2018.02 、maven3.5.4、tomcat9  maven的web工程QQ第三方登录接口引入,听起来简单,做完以后也很简单,这里使用 java SDK ;写的文字比较多,查了好多文章,写的模模糊糊的,只有自己写清楚了供大家参考,其实很简单的一个调用;maven的 web 开发qq接口引入,文档地址:http://wiki.connect.qq....
摘要由CSDN通过智能技术生成

声明、使用JDK9、idea2018.02 、maven3.5.4、tomcat9 

 

maven的web工程QQ第三方登录接口引入,听起来简单,做完以后也很简单,这里使用 java SDK ;

写的文字比较多,查了好多文章,写的模模糊糊的,只有自己写清楚了供大家参考,其实很简单的一个调用;

maven的 web 开发qq接口引入,文档地址:http://wiki.connect.qq.com/    

该处测试使用servlet注解方式,官方demo使用配置web.xml方式【重中之重一点需要更改Tomcat中context.xml配置】

<!-- 配置qq登录的文档库   -->
	<Context docBase="web" path="/" privileged="true" antiResourceLocking="false">
            </Context>

(1)申请审核5天左右,获得对应的  appid与appkey  ,创建应用,填写回调接口 (下面有图);

(2) js SDK下载   http://wiki.connect.qq.com/sdk%E4%B8%8B%E8%BD%BD

java SDK下载    http://wiki.open.qq.com/wiki/website/SDK%E4%B8%8B%E8%BD%BD

(3)log下载  图标下载;

(4)调用登录  和回调 函数,搭建 demo servlet 和依赖;


2018/10/16  审核通过;


在基本信息中填写回调接口,由于仅作为测试使用,所以填写的回调接口为 http://localhost:8080/afterLoginRedirectServlet

和回调的 servlet的 urlPatterns=" /afterLoginRedirectServlet "  要保持一致【重点】;

 如下图:

到此为止所需参数获取完毕,配置文件如下; 

app_ID = 你的appid
app_KEY = 你的key,下面的回调url根据个人情况更改,scope权限根据需求改【需要有这权限才能配置】
redirect_URI = http://localhost:8080/afterLoginRedirectServlet
scope = get_user_info
baseURL = https://graph.qq.com/
getUserInfoURL = https://graph.qq.com/user/get_user_info
accessTokenURL = https://graph.qq.com/oauth2.0/token
authorizeURL = https://graph.qq.com/oauth2.0/authorize
getOpenIDURL = https://graph.qq.com/oauth2.0/me
addTopicURL = https://graph.qq.com/shuoshuo/add_topic
addBlogURL = https://graph.qq.com/blog/add_one_blog
addAlbumURL = https://graph.qq.com/photo/add_album
uploadPicURL = https://graph.qq.com/photo/upload_pic
listAlbumURL = https://graph.qq.com/photo/list_album
addShareURL = https://graph.qq.com/share/add_share
checkPageFansURL = https://graph.qq.com/user/check_page_fans
addTURL = https://graph.qq.com/t/add_t
addPicTURL = https://graph.qq.com/t/add_pic_t
delTURL = https://graph.qq.com/t/del_t
getWeiboUserInfoURL = https://graph.qq.com/user/get_info
getWeiboOtherUserInfoURL = https://graph.qq.com/user/get_other_info
getFansListURL = https://graph.qq.com/relation/get_fanslist
getIdolsListURL = https://graph.qq.com/relation/get_idollist
addIdolURL = https://graph.qq.com/relation/add_idol
delIdolURL = https://graph.qq.com/relation/del_idol
getTenpayAddrURL = https://graph.qq.com/cft_info/get_tenpay_addr
getRepostListURL = https://graph.qq.com/t/get_repost_list
version = 2.0.0.0

 


声明,使用的maven工程,Tomcat9.0.10 ,JDK9进行测试;

 

开始调用接口测试 ,可以改写成基于baseSeverlet来测试,为了方便直接 coding:

逻辑说明 ,点击按钮,调用 IndexServlet 进行调用登录qq的功能;点击登录 qq ,会重定向调用回调  AfterLoginRedirectServlet ,用于获取用户信息;这里用于测试仅仅开通了 

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值