Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/leo0o/simpleoauth
Golang实现几大主流平台的oauth2.0认证(目前仅支持QQ,微信,微博)
https://github.com/leo0o/simpleoauth
go golang oauth2 qq wechat
Last synced: 2 months ago
JSON representation
Golang实现几大主流平台的oauth2.0认证(目前仅支持QQ,微信,微博)
- Host: GitHub
- URL: https://github.com/leo0o/simpleoauth
- Owner: leo0o
- Created: 2017-10-20T09:55:55.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-11-10T07:30:44.000Z (about 7 years ago)
- Last Synced: 2024-08-03T23:29:32.521Z (6 months ago)
- Topics: go, golang, oauth2, qq, wechat
- Language: Go
- Size: 16.6 KB
- Stars: 33
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-golang-repositories - simpleoauth
README
# simpleoauth
Golang实现几大主流平台的oauth2.0认证(目前仅支持QQ,微信,微博)
使用方法:
在config.go中配置好相关信息后package main
import (
"fmt"
"simpleoauth"
)func main() {
m, _ := simpleoauth.NewManager("qq")
result := m.Authorize("此处填入认证通过后,第三方平台跳转带回来的CODE")
fmt.Println(result)
}
返回结果为:type AuthorizeResult struct{
Result bool //认证成功或失败
Userinfo map[string]interface{} //返回用户信息等基本资料
}