forked from michaelsbradleyjr/gfms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscratchpad.txt
29 lines (22 loc) · 1 KB
/
scratchpad.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
/*
Ref: http://developer.github.com/v3/oauth/
Ref: https://github.com/settings/applications/new
Ref: http://developer.github.com/v3/markdown/
POST to: https://github.com/markdown { text: 'text', mode: 'markdown' }
Response: body
if error:
1. redirect to: https://github.com/login/oauth/authorize
?client_id=APPID
&redirect_uri=http://HOST:PORT
&state=RANDOM
2. catch the ?code= param
3. server POST to: https://github.com/login/oauth/access_token
?client_id=APPID
&client_secret=APPSECRET
&code=CODE
&state=RANDOM
header: Accept: application/json
response: { access_token: }
4. repeat the POST as /markdown?access_token=ACCESSTOKEN
5. if error, go again with the redir, user will bail out as they see fit
*/