1- # Authorization Code Grant
2-
3- ![ login] ( https://raw.githubusercontent.com/go-oauth2/oauth2/master/example/server/static/login.png )
4- ![ auth] ( https://raw.githubusercontent.com/go-oauth2/oauth2/master/example/server/static/auth.png )
5- ![ token] ( https://raw.githubusercontent.com/go-oauth2/oauth2/master/example/server/static/token.png )
1+ # Use Examples
62
73## Run Server
84
@@ -20,7 +16,9 @@ $ go build client.go
2016$ ./client
2117```
2218
23- ## Open the browser
19+ ## Authorization Code Grant
20+
21+ ### Open the browser
2422
2523[ http://localhost:9094 ] ( http://localhost:9094 )
2624
@@ -34,7 +32,7 @@ $ ./client
3432```
3533
3634
37- ## Try access token
35+ ### Try access token
3836
3937Open the browser [ http://localhost:9094/try ] ( http://localhost:9094/try )
4038
@@ -57,4 +55,33 @@ Open the browser [http://localhost:9094/refresh](http://localhost:9094/refresh)
5755 "refresh_token": "AG6-63MLXUEFUV2Q_BLYIW",
5856 "expiry": "2019-01-09T23:03:16.374062+08:00"
5957}
60- ```
58+ ```
59+
60+ ## Password Credentials Grant
61+
62+ Open the browser [ http://localhost:9094/pwd ] ( http://localhost:9094/pwd )
63+
64+ ```
65+ {
66+ "access_token": "87JT3N6WOWANXVDNZFHY7Q",
67+ "token_type": "Bearer",
68+ "refresh_token": "LDIS6PXAVY-BXHPEDESWNG",
69+ "expiry": "2019-02-12T10:58:43.734902+08:00"
70+ }
71+ ```
72+
73+ ## Client Credentials Grant
74+
75+ Open the browser [ http://localhost:9094/client ] ( http://localhost:9094/client )
76+
77+ ```
78+ {
79+ "access_token": "OA6ITALNMDOGD58C0SN-MG",
80+ "token_type": "Bearer",
81+ "expiry": "2019-02-12T11:10:35.864838+08:00"
82+ }
83+ ```
84+
85+ ![ login] ( https://raw.githubusercontent.com/go-oauth2/oauth2/master/example/server/static/login.png )
86+ ![ auth] ( https://raw.githubusercontent.com/go-oauth2/oauth2/master/example/server/static/auth.png )
87+ ![ token] ( https://raw.githubusercontent.com/go-oauth2/oauth2/master/example/server/static/token.png )
0 commit comments