thirdparty

command module
v1.2.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

README

thirdparty

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

微信授权登录
package main

import (
	"fmt"
	"gitee.com/cf-soft/thirdparty/oauth"
)

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

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

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL