Giter Club home page Giter Club logo

oauthsdk's People

Contributors

westhack avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

oauthsdk's Issues

authorize无法通过配置修改?

我的配置

    //腾讯微信配置
    'WECHAT' => array(
        'APP_KEY' => '123456', //应用注册成功后分配的 APP ID
        'APP_SECRET' => '9cc9ac2fb17d010104d8a58dbebb4d3a', //应用注册成功后分配的KEY
        'AUTHORIZE' => 'snsapi_userinfo',
        'CALLBACK' => 'http://www.example.com/callback.php?type=wechat',//回调URL
    )

但是我调用还是 AUTHORIZE 的值还是 snsapi_login

sdk/WechatSDK.php

        /**
	 * 获取request_code的额外参数,可在配置中修改 URL查询字符串格式
	 * @var srting
	 */
	protected $authorize = 'scope=snsapi_login';

新浪微博登录报错

/** * 获取用户信息 * @return array||bool * @throws \Exception */ public function getUserInfo(){ $params['uid'] = $this->openid(); $response = $this->call('users/show',$params); if ($response['ret'] == 0) { $userInfo['openid'] = $this->openid(); $userInfo['username'] = $response['screen_name']; $userInfo['avatar'] = $response['profile_image_url']; $userInfo['sex'] = $response['gender']=='m'?1:2; return $userInfo; } else { return false; } }

if ($response['ret'] == 0) {
应该改为:
if ($response['error_code'] == 0) {

在做小程序的时候发现, 还有一个微信登录.

官方文档-wx.login

code 换取 session_key
​这是一个 HTTPS 接口,开发者服务器使用登录凭证 code 获取 session_key 和 openid。

session_key 是对用户数据进行加密签名的密钥。为了自身应用安全,session_key 不应该在网络上传输。

接口地址:

https://api.weixin.qq.com/sns/jscode2session?appid=APPID&secret=SECRET&js_code=JSCODE&grant_type=authorization_code

这个小程序登录是否也可以直接封装到SDK中?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.