Download the PHP package faysoft/fayoauth without Composer
On this page you can find all versions of the php package faysoft/fayoauth. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package fayoauth
第三方登录模块
此模块仅完成第三方登录信息获取,不涉及创建本地用户等业务逻辑操作。
调用代码
代码介绍
ClientAbstract用于获取Access Token,state值校验等操作AccessTokenAbstractAccess Token实例,可通过此实例获取用户信息OauthService由于不同第三方登录参数略有区别,用OauthService来统一调用入口getAccessToken()获取Access Token(AccessTokenAbstract实例)getUser()获取第三方用户信息(返回UserAbstract实例)getOpenId()获取用户openId
UserAbstract第三方返回的用户信息各有不同,用此类来统一用户信息获取方法getAccessToken()获取Access Token值(字符串)getNickName()获取用户昵称getOpenId()获取用户openIdgetUnionId()获取用户UnionId。目前好像就微信有这个值getAvatar()获取用户头像getParams()获取所有原生第三方用户信息getParam($name)根据原生第三方用户信息字段获取用户信息__get()可以通过魔术方法调用getParam()ArrayAccess可以通过数组的方式调用getParam()
StateManager用于管理state
总结:
Client和AccessToken类用于实现第三方登录。OauthService和User类用于统一调用和返回数据格式。
扩展登录方式时,需要实现AccessTokenAbstract, ClientAbstract, OauthService, UserAbstract类。
All versions of fayoauth with dependencies
PHP Build Version
Package Version
Requires
faysoft/cms Version
*
The package faysoft/fayoauth contains the following files
Loading the files please wait ...