GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - leo0o/sns-oauth: 简单好用的第三方登录composer包

BranchesTags
Open more actions menu

Latest commit

 

History

18 Commits
18 Commits

Folders and files

NameName
Last commit message
Last commit date
src/SNSOAuth
src/SNSOAuth
 
 
vendor
vendor
 
 
README.md
README.md
 
 
composer.json
composer.json
 
 

Repository files navigation

sns-oauth

oauth2.0 通过回调返回的code获取用户相关信息,支持平台:

  • 微博
  • 微信
  • qq

安装

php composer.phar require leo0o/sns-oauth or composer require leo0o/sns-oauth

使用

try {
    $wechat = new \oauth\OAuth('平台类型, 如:\SNSOAuth\Common\Platform::SINA_WEIBO' , [
            'appKey'=>'你的appkey',
            'appSecret'=>'你的appsecret',
            'redirectUrl'=>'回调地址,必传'
            ]);
    $userinfo = $wechat->Authrize('回调带回的code');
} catch (OAuthException $e) {
    var_dump(echo $e->getMessage());
}

返回格式:

[
    'nickname'      =>  '',   
    'openid'        =>  '',   
    'sex'           =>  '',   //0未知, 1男, 2女
    'headimgurl'    =>  '',
    'unionid'       =>  ''
]

About

简单好用的第三方登录composer包

Topics

loginoauth2qqsnsthirdpartyweiboweixin

Resources

Readme
Activity

Stars

1 star

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.