-
Notifications
You must be signed in to change notification settings - Fork 19
/
kakao.go
43 lines (36 loc) · 803 Bytes
/
kakao.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package kakao
import (
"net/url"
oauthHelper "github.com/dorajistyle/goyangi/util/oauth2"
"golang.org/x/oauth2"
)
const (
ProviderId = 7
Scheme = "https"
Host = "kapi.kakao.com"
Opaque = "//kapi.kakao.com/v1/user/me"
AuthURL = "https://kauth.kakao.com/oauth/authorize"
TokenURL = "https://kauth.kakao.com/oauth/token"
)
var RequestURL = &url.URL{
Scheme: Scheme,
Host: Host,
Opaque: Opaque,
}
var Endpoint = oauth2.Endpoint{
AuthURL: AuthURL,
TokenURL: TokenURL,
}
var Config = Oauth2Config()
func Oauth2Config() *oauth2.Config {
id, secret, redirectURL := oauthHelper.GetProvider("kakao")
return &oauth2.Config{
ClientID: id,
ClientSecret: secret,
RedirectURL: redirectURL,
Scopes: []string{
"Basic_Profile",
},
Endpoint: Endpoint,
}
}