mirror of
https://github.com/wahyd4/loginsrv.git
synced 2026-08-09 04:46:29 +10:00
19 lines
527 B
Go
19 lines
527 B
Go
package oauth2
|
|
|
|
var githubApi = "https://api.github.com/v3"
|
|
|
|
func init() {
|
|
RegisterProvider(providerGithub)
|
|
}
|
|
|
|
var providerGithub = Provider{
|
|
Name: "github",
|
|
AuthURL: "https://github.com/login/oauth/authorize",
|
|
TokenURL: "https://github.com/login/oauth/access_token",
|
|
GetUserInfo: func(token TokenInfo) (map[string]string, error) {
|
|
//http.Get(fmt.Sprintf("%v/user?access_token=%v"), githubApi, token.AccessToken)
|
|
// https://developer.github.com/v3/users/
|
|
return map[string]string{"username": "demo"}, nil
|
|
},
|
|
}
|