forked from danilopolani/gocialite
/
linkedin.go
39 lines (31 loc) · 1.17 KB
/
linkedin.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
package drivers
import (
"net/http"
"github.com/lietu/gocialite/structs"
"golang.org/x/oauth2/linkedin"
)
const (
linkedinDriverName = "linkedin"
)
func init() {
registerDriver(linkedinDriverName, LinkedInDefaultScopes, LinkedInUserFn, linkedin.Endpoint, LinkedInAPIMap, LinkedInUserMap)
}
// LinkedInUserMap is the map to create the User struct
var LinkedInUserMap = map[string]string{
"id": "ID",
"vanityName": "Username",
"firstName": "FirstName",
"lastName": "LastName",
"formattedName": "FullName",
"emailAddress": "Email",
"pictureUrl": "Avatar",
}
// LinkedInAPIMap is the map for API endpoints
var LinkedInAPIMap = map[string]string{
"endpoint": "https://api.linkedin.com",
"userEndpoint": "/v1/people/~:(id,first-name,last-name,formatted-name,email-address,picture-url,maiden-name,headline,location,industry,current-share,num-connections,summary,specialties,positions,public-profile-url)?format=json",
}
// LinkedInUserFn is a callback to parse additional fields for User
var LinkedInUserFn = func(client *http.Client, u *structs.User) {}
// LinkedInDefaultScopes contains the default scopes
var LinkedInDefaultScopes = []string{}