-
Notifications
You must be signed in to change notification settings - Fork 3
/
oauth.txt
95 lines (75 loc) · 3.71 KB
/
oauth.txt
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
OAUTH 42 ->
App id = 410d148df61a4dc6e462bba98b4beda91b3bb56582a44a2a29775a9e0e3cb2d9
App secret = 0e156668ef0c973c8fa8526fc683f26ce42801788756de614a307eee406ce1b8
Redirect uri (can add more) = http://localhost:3000/
To get token =>
Send user to ->
https://api.intra.42.fr/oauth/authorize?client_id=410d148df61a4dc6e462bba98b4beda91b3bb56582a44a2a29775a9e0e3cb2d9&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2F&response_type=code
(can change redirect_uri)
-> Redirects to redirect_uri with code in get
curl -F grant_type=authorization_code \
-F client_id=410d148df61a4dc6e462bba98b4beda91b3bb56582a44a2a29775a9e0e3cb2d9 \
-F client_secret=0e156668ef0c973c8fa8526fc683f26ce42801788756de614a307eee406ce1b8 \
-F code=USERS_CODE \
-F redirect_uri=http://localhost:3000/ \
-X POST https://api.intra.42.fr/oauth/token
=> Access token
Then =>
curl -H "Authorization: Bearer USERS_TOKEN" https://api.intra.42.fr/v2/me
email: 'user_mail'
login: 'username'
first_name: 'users_first_name'
last_name: 'users_last_name'
OAUTH Github ->
App id = 419e2d89b672ff004243
App secret = 92199f0bad146feada6328e12e14021dd91a4ea9
Redirect uri (can add more) = http://localhost:3000/
To get token =>
Send user to ->
https://github.com/login/oauth/authorize?client_id=419e2d89b672ff004243
(can change redirect_uri)
-> Redirects to redirect_uri with code in get
curl -F client_id=419e2d89b672ff004243 \
-F client_secret=92199f0bad146feada6328e12e14021dd91a4ea9 \
-F code=USERS_CODE \
-F redirect_uri=http://localhost:3000/ \
-X POST https://github.com/login/oauth/access_token
=> Access token
Then =>
curl -H "Authorization: Token USERS_TOKEN" https://api.github.com/user
email: 'user_mail'
login: 'username'
name: 'users_name'
OAUTH Twitter ->
APP UNDER REVIEW
OAUTH Facebook ->
App id = 915807418753565
App secret = bd4d7dc40ecbabdb08f7d5df4557acdb
To get token =>
Send user to ->
https://www.facebook.com/v3.2/dialog/oauth?client_id=915807418753565&redirect_uri=http://localhost:3000/&display=popup&response_type=token
(can change redirect_uri)
-> Redirects to redirect_uri with code in get
curl -X GET https://graph.facebook.com/v3.2/oauth/access_token?
client_id=915807418753565
&client_secret=bd4d7dc40ecbabdb08f7d5df4557acdb
&code=USERS_CODE
&redirect_uri=http://localhost:3000/
=> Access token
Then =>
PAS TROUVÉ FB C DLA MERDE
OAUTH Gmail ->
Client id = 39760124824-ehshl281mip2ejm0f9l5vkgdb672j16g.apps.googleusercontent.com
Client secret = MfrqQ_-ZgG7kZWHQnAn9cz1b
To get code => https://accounts.google.com/o/oauth2/v2/auth?client_id=39760124824-ehshl281mip2ejm0f9l5vkgdb672j16g.apps.googleusercontent.com&response_type=code&redirect_uri=https://hypertube.barthonet.ovh/oauth/gmail&scope=https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/gmail.readonly&access_type=offline
To get token =>
curl -F code=USERS_CODE
-F client_id=39760124824-ehshl281mip2ejm0f9l5vkgdb672j16g.apps.googleusercontent.com
-F client_secret=MfrqQ_-ZgG7kZWHQnAn9cz1b
-F grant_type=authorization_code
-F redirect_uri=https://hypertube.barthonet.ovh/oauth/gmail
-X POST https://www.googleapis.com/oauth2/v4/token
Then =>
With bearer
Mail -> https://www.googleapis.com/gmail/v1/users/me/profile
Rest -> https://www.googleapis.com/oauth2/v1/userinfo\?alt\=json