-
Notifications
You must be signed in to change notification settings - Fork 19
/
twitter.go
43 lines (36 loc) · 838 Bytes
/
twitter.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 twitter
import (
"net/url"
oauthHelper "github.com/dorajistyle/goyangi/util/oauth2"
"golang.org/x/oauth2"
)
const (
ProviderId = 5
Scheme = "https"
Host = "api.twitter.com"
Opaque = "//api.twitter.com/1.1/account/verify_credentials.json"
AuthURL = "https://api.twitter.com/oauth/authenticate"
TokenURL = "https://api.twitter.com/oauth/access_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("twitter")
return &oauth2.Config{
ClientID: id,
ClientSecret: secret,
RedirectURL: redirectURL,
// Scopes: []string{
// ,
// },
Endpoint: Endpoint,
}
}