-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
providers.go
146 lines (145 loc) · 5.26 KB
/
providers.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
package oauth2
var (
ProviderIDMap = map[string]Provider{
"amazon": Provider{
ID: "amazon",
AuthorizeURL: "https://www.amazon.com/ap/oa",
TokenURL: "https://api.amazon.com/auth/o2/token",
MeURL: "https://api.amazon.com/user/profile",
Scope: "profile",
NameProp: "name",
IDProp: "user_id",
Logo: "https://unpkg.com/simple-icons@latest/icons/amazon.svg",
Color: "#FF9900",
},
"battle.net": Provider{
ID: "battle.net",
AuthorizeURL: "https://us.battle.net/oauth/authorize",
TokenURL: "https://us.battle.net/oauth/token",
MeURL: "https://us.battle.net/oauth/userinfo",
Scope: "openid",
NameProp: "battletag",
Logo: "https://unpkg.com/simple-icons@latest/icons/battle-dot-net.svg",
Color: "#00AEFF",
},
"discord": Provider{
ID: "discord",
AuthorizeURL: "https://discordapp.com/api/oauth2/authorize",
TokenURL: "https://discordapp.com/api/oauth2/token",
MeURL: "https://discordapp.com/api/users/@me",
Scope: "identify",
NameProp: "username",
NamePrefix: "@",
Logo: "https://unpkg.com/simple-icons@latest/icons/discord.svg",
Color: "#7289DA",
},
"facebook": Provider{
ID: "facebook",
AuthorizeURL: "https://graph.facebook.com/oauth/authorize",
TokenURL: "https://graph.facebook.com/oauth/access_token",
MeURL: "https://graph.facebook.com/me",
NameProp: "name",
Logo: "https://unpkg.com/simple-icons@latest/icons/facebook.svg",
Color: "#1877F2",
},
"github": Provider{
ID: "github",
AuthorizeURL: "https://github.com/login/oauth/authorize",
TokenURL: "https://github.com/login/oauth/access_token",
MeURL: "https://api.github.com/user",
Scope: "read:user",
NameProp: "login",
NamePrefix: "@",
Logo: "https://unpkg.com/simple-icons@latest/icons/github.svg",
Color: "#181717",
},
"gitlab.com": Provider{
ID: "gitlab.com",
AuthorizeURL: "https://gitlab.com/oauth/authorize",
TokenURL: "https://gitlab.com/oauth/token",
MeURL: "https://gitlab.com/api/v4/user",
Scope: "read_user",
NameProp: "username",
NamePrefix: "@",
Logo: "https://unpkg.com/simple-icons@latest/icons/gitlab.svg",
Color: "#FCA121",
},
"google": Provider{
ID: "google",
AuthorizeURL: "https://accounts.google.com/o/oauth2/v2/auth",
TokenURL: "https://www.googleapis.com/oauth2/v4/token",
MeURL: "https://www.googleapis.com/oauth2/v1/userinfo?alt=json",
Scope: "profile",
NameProp: "name",
Logo: "https://unpkg.com/simple-icons@latest/icons/google.svg",
Color: "#4285F4",
},
"microsoft": Provider{
ID: "microsoft",
AuthorizeURL: "https://login.microsoftonline.com/common/oauth2/v2.0/authorize",
TokenURL: "https://login.microsoftonline.com/common/oauth2/v2.0/token",
MeURL: "https://graph.microsoft.com/v1.0/me/",
Scope: "https://graph.microsoft.com/user.read",
NameProp: "displayName",
Logo: "https://unpkg.com/simple-icons@latest/icons/microsoft.svg",
Color: "#666666",
},
"reddit": Provider{
ID: "reddit",
AuthorizeURL: "https://old.reddit.com/api/v1/authorize",
TokenURL: "https://old.reddit.com/api/v1/access_token",
MeURL: "https://oauth.reddit.com/api/v1/me",
Scope: "identity",
NameProp: "name",
NamePrefix: "u/",
Logo: "https://unpkg.com/simple-icons@latest/icons/reddit.svg",
Color: "#FF4500",
},
//
//
//
"_gitea": Provider{
ID: "gitea",
AuthorizeURL: "https://{domain}/login/oauth/authorize",
TokenURL: "https://{domain}/login/oauth/access_token",
MeURL: "https://{domain}/api/v1/user",
NameProp: "username",
NamePrefix: "@",
Logo: "https://unpkg.com/simple-icons@latest/icons/gitea.svg",
Color: "#609926",
},
"_gitlab": Provider{
ID: "gitlab",
AuthorizeURL: "https://{domain}/oauth/authorize",
TokenURL: "https://{domain}/oauth/token",
MeURL: "https://{domain}/api/v4/user",
Scope: "read_user",
NameProp: "username",
NamePrefix: "@",
Logo: "https://unpkg.com/simple-icons@latest/icons/gitlab.svg",
Color: "#FCA121",
},
"_mastodon": Provider{
ID: "mastodon",
AuthorizeURL: "https://{domain}/oauth/authorize",
TokenURL: "https://{domain}/oauth/token",
MeURL: "https://{domain}/api/v1/accounts/verify_credentials",
Scope: "read:accounts",
NameProp: "username",
NamePrefix: "@",
Logo: "https://unpkg.com/simple-icons@latest/icons/mastodon.svg",
Color: "#3088D4",
},
"_pleroma": Provider{
ID: "pleroma",
AuthorizeURL: "https://{domain}/oauth/authorize",
TokenURL: "https://{domain}/oauth/token",
MeURL: "https://{domain}/api/v1/accounts/verify_credentials",
Scope: "read:accounts",
NameProp: "username",
NamePrefix: "@",
Logo: "https://unpkg.com/simple-icons@latest/icons/pleroma.svg",
Color: "#FBA457",
},
}
)