-
Notifications
You must be signed in to change notification settings - Fork 19
/
naver.go
44 lines (37 loc) · 835 Bytes
/
naver.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
44
package naver
import (
"net/url"
oauthHelper "github.com/dorajistyle/goyangi/util/oauth2"
"golang.org/x/oauth2"
)
const (
ProviderId = 8
Scheme = "https"
Host = "apis.naver.com"
Opaque = "//apis.naver.com/nidlogin/nid/getUserProfile.xml"
AuthURL = "https://nid.naver.com/oauth2.0/authorize"
TokenURL = "https://nid.naver.com//oauth2.0/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("naver")
return &oauth2.Config{
ClientID: id,
ClientSecret: secret,
RedirectURL: redirectURL,
Scopes: []string{
"user",
"user:email",
},
Endpoint: Endpoint,
}
}