Skip to content

Go语言实现的第三方登录开源库,整合QQ、微信、微博、Github等第三方平台的授权登录

License

Notifications You must be signed in to change notification settings

okh258/thirdparty

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

thirdparty

Go语言实现的第三方授权登录,整合QQ、微信、微信小程序、微博、抖音、支付宝等第三方平台的授权登录

微信授权登录

package main

import (
	"fmt"
	"github.com/inkrtech/thirdparty/oauth"
)

func main()  {
	wxConf := &oauth.AuthConf{
        ClientId: "your app_id", 
        ClientSecret: "your app_secret", 
        RedirectUrl: "http://www.geiqin.com"}

	wxAuth := oauth.NewAuthWxWechat(wxConf)
	fmt.Print(wxAuth.GetRedirectUrl("sate")) //获取第三方登录地址
	wxRes, err := wxAuth.GetAppAccessToken("code")
	userInfo, _ := wxAuth.GetUserInfo(wxRes.AccessToken, wxRes.OpenId)
}

About

Go语言实现的第三方登录开源库,整合QQ、微信、微博、Github等第三方平台的授权登录

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%