网站QQ登陆怎么实现

WBOY
Release: 2016-06-13 12:05:37
Original
1156 people have browsed it

网站QQ登陆如何实现
已经下载好了官方的SDK,但是不知道如何集成到网站当中?
------解决方案--------------------
点击QQ登录按钮,跳转到一个php页面,执行qq_login()方法,跳转到QQ授权页
授权完成会跳回到你设置的回调页地址
在该页面执行qq_callback()方法获取Oauth2.0的Token
执行get_openid();获取openid(唯一)
再跳转到绑定页或者注册页,绑定或注册后将uid与Token和openid存在一个qq登录表
下次再QQ登录时,在回调页获取openid后,到QQ登录表查询是否存在,若存在就直接登录,不存在就跳到绑定或注册页

------解决方案--------------------
參考:http://wiki.open.qq.com/wiki/website/%E5%87%86%E5%A4%87%E5%B7%A5%E4%BD%9C_OAuth2.0

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template