|
1 | 1 | # Golang OAuth 2.0 |
2 | 2 |
|
3 | | -> An open protocol to allow secure authorization in a simple and standard method from web, mobile and desktop applications. |
| 3 | +> An open protocol to allow secure authorization in a simple and standard method from web, mobile and desktop applications. |
4 | 4 |
|
5 | | -[![License][License-Image]][License-Url] [![ReportCard][ReportCard-Image]][ReportCard-Url] [![Build][Build-Status-Image]][Build-Status-Url] [![Coverage][Coverage-Image]][Coverage-Url] [![GoDoc][GoDoc-Image]][GoDoc-Url] [![Release][Release-Image]][Release-Url] |
| 5 | +[![License][License-Image]][License-Url] [![ReportCard][ReportCard-Image]][ReportCard-Url] [![Build][Build-Status-Image]][Build-Status-Url] [![Coverage][Coverage-Image]][Coverage-Url] [![GoDoc][GoDoc-Image]][GoDoc-Url] |
6 | 6 |
|
7 | 7 | ## Protocol Flow |
8 | 8 |
|
9 | | -``` |
| 9 | +``` text |
10 | 10 | +--------+ +---------------+ |
11 | 11 | | |--(A)- Authorization Request ->| Resource | |
12 | 12 | | | | Owner | |
|
31 | 31 | ### Download and install |
32 | 32 |
|
33 | 33 | ``` bash |
34 | | -$ go get -u gopkg.in/oauth2.v3/... |
| 34 | +go get -u -v gopkg.in/oauth2.v3/... |
35 | 35 | ``` |
36 | 36 |
|
37 | 37 | ### Create file `server.go` |
@@ -96,15 +96,14 @@ func main() { |
96 | 96 | ### Build and run |
97 | 97 |
|
98 | 98 | ``` bash |
99 | | -$ go build server.go |
100 | | -$ ./server |
| 99 | +go build server.go |
| 100 | + |
| 101 | +./server |
101 | 102 | ``` |
102 | 103 |
|
103 | 104 | ### Open in your web browser |
104 | 105 |
|
105 | | -``` |
106 | | -http://localhost:9096/token?grant_type=client_credentials&client_id=000000&client_secret=999999&scope=read |
107 | | -``` |
| 106 | +[http://localhost:9096/token?grant_type=client_credentials&client_id=000000&client_secret=999999&scope=read](http://localhost:9096/token?grant_type=client_credentials&client_id=000000&client_secret=999999&scope=read) |
108 | 107 |
|
109 | 108 | ``` json |
110 | 109 | { |
@@ -138,16 +137,12 @@ Simulation examples of authorization code model, please check [example](/example |
138 | 137 |
|
139 | 138 | ## MIT License |
140 | 139 |
|
141 | | -``` |
142 | | -Copyright (c) 2016 Lyric |
143 | | -``` |
| 140 | + Copyright (c) 2016 Lyric |
144 | 141 |
|
145 | 142 | [License-Url]: http://opensource.org/licenses/MIT |
146 | 143 | [License-Image]: https://img.shields.io/npm/l/express.svg |
147 | 144 | [Build-Status-Url]: https://travis-ci.org/go-oauth2/oauth2 |
148 | 145 | [Build-Status-Image]: https://travis-ci.org/go-oauth2/oauth2.svg?branch=master |
149 | | -[Release-Url]: https://github.com/go-oauth2/oauth2/releases/tag/v3.7.0 |
150 | | -[Release-image]: http://img.shields.io/badge/release-v3.7.0-1eb0fc.svg |
151 | 146 | [ReportCard-Url]: https://goreportcard.com/report/gopkg.in/oauth2.v3 |
152 | 147 | [ReportCard-Image]: https://goreportcard.com/badge/gopkg.in/oauth2.v3 |
153 | 148 | [GoDoc-Url]: https://godoc.org/gopkg.in/oauth2.v3 |
|
0 commit comments