qq怎么注册推特账号(qq邮箱能注册推特吗)

未标题-1-4 (1).png

1.1 弟三方登录

所谓的弟三方登录,就是APP识别到用户将弟三方的账号绑定到自己平台的 ID上直接完成登录的过程,简单来说,是指基于用户在弟三方平台上已有的账号和密码来快速完成己方应用的登录或者注册的功能。常见的弟三方登录平台,一般是已经拥有大量用户的平台,国内的就是各大厂:微信、微博、QQ 等,国外有 Facebook、Twitter。

1.2 扫码登录

现在的弟三方平台基本都支持扫码登录,因为扫码登录更加安全,

而且不用记账号和密码

如:微信、qq、支付宝

2. QQ弟三方登录

2.1 qq互联

https://connect.qq.com/

2.2 注册开发者

2.3 文档

3. OAuth2.0 介绍

3.1. QQ登录OAuth2.0总体处理流程

QQ登录OAuth2.0总体处理流程如下:

Step1:申请接入,获取appid和apikey;

Step2:开发应用,并设置协作者帐号进行测试联调;

Step3:放置QQ登录按钮;

Step4:通过用户登录验证和授权,获取Access Token;

Step5:通过Access Token获取用户的OpenID;

Step6:调用OpenAPI,来请求访问或修改用户授权的资源。

4. 项目集成qq登录

4.1 maven导入包

<!-- QQ弟三方登录-->

<dependency>

<groupId>net.gplatform</groupId>

<artifactId>Sdk4J</artifactId>

<version>2.0</version>

</dependency>

4.2. 配置

蕞好查看qq给出的demo例子

创建 qqconnectconfig.properties放在resources根目录下

app_ID = 101543517

app_KEY = 3d43255254a6f50876661fe2bec86684

redirect_URI = http://javatv.cn/loginAfter

scope = get_user_info,add_topic,add_one_blog,add_album,upload_pic,list_album,add_share,check_page_fans,add_t,add_pic_t,del_t,get_repost_list,get_info,get_other_info,get_fanslist,get_idollist,add_idol,del_ido,get_tenpay_addr

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

4.3. 建包oauth2并扫描

<context:component-scan base-package=\\\"cn.itsource.oauth2\\\" />

4.4. 编写qqcontroller

@Controllerpublic class QQController { @Autowired RestTemplate restTemplate; @Autowired UserService userService; // 将页面重定向到qq弟三方的登录页面 @RequestMapping public void qqLogin { try { response.setContentType; response.sendRedirect.getAuthorizeURL);//将页面重定向到qq弟三方的登录页面 } catch { e.printStackTrace; } } // 登录之后回调地址 @RequestMapping public String qqLoginAfter { try { System.err.println; AccessToken accessTokenObj = ).getAccessTokenByRequest; String accessToken = null, openID = null; long tokenExpireIn = 0L; if .equals) {// 我们的网站被CSRF攻击了或者用户取消了授权 System.out.print; } else { accessToken = accessTokenObj.getAccessToken; tokenExpireIn = accessTokenObj.getExpireIn; // 利用获取到的accessToken 去获取当前用的openid -------- start OpenID openIDObj = new OpenID; openID = openIDObj.getUserOpenID; System.err.println; // 获取qq信息 String url = \\\"https://graph.qq.com/user/get_user_info?access_token=\\\" + accessToken + \\\"&oauth_consumer_key=101543517\\\" + \\\"&openid=\\\" + openID + \\\"&format=json \\\"; String json = restTemplate.getForObject; ObjectMapper objectMapper = new ObjectMapper; HashMap map = objectMapper.readValue; System.err.println; System.err.println); // 如果用户表没有当前openid,那就添加用户,如果就有就直接跳转主界面main.jsp\\ User user = new User; user.setQqOpenId; User u = userService.queryByParam; if { System.out.println; return \\\"main\\\"; } else { // 添加用户 user.setHeadImg map.get); user.setLoginName.toString); user.setLoginPwd; userService.insert; return \\\"main\\\"; } } } catch { e.printStackTrace; } return null; }}

4.5 登录页面加入QQ登录

页面加入

绑定事件

4.6. 修改 hosts

C:\\Windows\\System32\\drivers\\etc

修改hosts文件,在末尾加入

127.0.0.1 javatv.cn

海外精品引流脚本--最强海外引流  

官网:www.facebook18.com

唯一TG:https://t.me/Facebook181818

Facebook.png

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注

2 × 4 =

Scroll to Top

注意!注意!

现有骗子用我们演示视频行骗!不要手动输入我的飞机用户名“咨询客服、脚本客服均是骗子”注意防范
您在官方购买脚本后有一条龙的售后服务、教程、更新、维护、资源、讲解等等。没任何后续费用!

官方唯一客服TG:Facebook181818

    QQ236399287

点击上方TG号,或加QQ号与官方取的联系,或点击下方加入TG频道关注官方消息!请认准,谨防上当受骗哦~