22
33> An open protocol to allow secure authorization in a simple and standard method from web, mobile and desktop applications.
44
5- [ ![ Build] [ Build-Status-Image ]] [ Build-Status-Url ] [ ![ Codecov] [ codecov-image ]] [ codecov-url ] [ ![ ReportCard] [ reportcard-image ]] [ reportcard-url ] [ ![ GoDoc] [ godoc-image ]] [ godoc-url ] [ ![ License] [ license-image ]] [ license-url ]
5+ [ ![ Build] [ build-status-image ]] [ build-status-url ] [ ![ Codecov] [ codecov-image ]] [ codecov-url ] [ ![ ReportCard] [ reportcard-image ]] [ reportcard-url ] [ ![ GoDoc] [ godoc-image ]] [ godoc-url ] [ ![ License] [ license-image ]] [ license-url ]
66
77## Protocol Flow
88
9- ``` text
9+ ``` text
1010 +--------+ +---------------+
1111 | |--(A)- Authorization Request ->| Resource |
1212 | | | Owner |
3030
3131### Download and install
3232
33- ``` bash
33+ ``` bash
3434go get -u -v github.com/go-oauth2/oauth2/v4/...
3535```
3636
3737### Create file ` server.go `
3838
39- ``` go
39+ ``` go
4040package main
4141
4242import (
@@ -95,7 +95,7 @@ func main() {
9595
9696### Build and run
9797
98- ``` bash
98+ ``` bash
9999go build server.go
100100
101101./server
@@ -105,24 +105,24 @@ go build server.go
105105
106106[ 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 )
107107
108- ``` json
108+ ``` json
109109{
110- "access_token" : " J86XVRYSNFCFI233KXDL0Q" ,
111- "expires_in" : 7200 ,
112- "scope" : " read" ,
113- "token_type" : " Bearer"
110+ "access_token" : " J86XVRYSNFCFI233KXDL0Q" ,
111+ "expires_in" : 7200 ,
112+ "scope" : " read" ,
113+ "token_type" : " Bearer"
114114}
115115```
116116
117117## Features
118118
119- * Easy to use
120- * Based on the [ RFC 6749] ( https://tools.ietf.org/html/rfc6749 ) implementation
121- * Token storage support TTL
122- * Support custom expiration time of the access token
123- * Support custom extension field
124- * Support custom scope
125- * Support jwt to generate access tokens
119+ - Easy to use
120+ - Based on the [ RFC 6749] ( https://tools.ietf.org/html/rfc6749 ) implementation
121+ - Token storage support TTL
122+ - Support custom expiration time of the access token
123+ - Support custom extension field
124+ - Support custom scope
125+ - Support jwt to generate access tokens
126126
127127## Example
128128
@@ -161,28 +161,28 @@ if !ok || !token.Valid {
161161
162162## Store Implements
163163
164- * [ BuntDB] ( https://github.com/tidwall/buntdb ) (default store)
165- * [ Redis] ( https://github.com/go-oauth2/redis )
166- * [ MongoDB] ( https://github.com/go-oauth2/mongo )
167- * [ MySQL] ( https://github.com/go-oauth2/mysql )
168- * [ MySQL (Provides both client and token store)] ( https://github.com/imrenagi/go-oauth2-mysql )
169- * [ PostgreSQL] ( https://github.com/vgarvardt/go-oauth2-pg )
170- * [ DynamoDB] ( https://github.com/contamobi/go-oauth2-dynamodb )
171- * [ XORM] ( https://github.com/techknowlogick/go-oauth2-xorm )
172- * [ XORM (MySQL, client and token store)] ( https://github.com/rainlay/go-oauth2-xorm )
173- * [ GORM] ( https://github.com/techknowlogick/go-oauth2-gorm )
174- * [ Firestore] ( https://github.com/tslamic/go-oauth2-firestore )
164+ - [ BuntDB] ( https://github.com/tidwall/buntdb ) (default store)
165+ - [ Redis] ( https://github.com/go-oauth2/redis )
166+ - [ MongoDB] ( https://github.com/go-oauth2/mongo )
167+ - [ MySQL] ( https://github.com/go-oauth2/mysql )
168+ - [ MySQL (Provides both client and token store)] ( https://github.com/imrenagi/go-oauth2-mysql )
169+ - [ PostgreSQL] ( https://github.com/vgarvardt/go-oauth2-pg )
170+ - [ DynamoDB] ( https://github.com/contamobi/go-oauth2-dynamodb )
171+ - [ XORM] ( https://github.com/techknowlogick/go-oauth2-xorm )
172+ - [ XORM (MySQL, client and token store)] ( https://github.com/rainlay/go-oauth2-xorm )
173+ - [ GORM] ( https://github.com/techknowlogick/go-oauth2-gorm )
174+ - [ Firestore] ( https://github.com/tslamic/go-oauth2-firestore )
175175
176176## Handy Utilities
177177
178- * [ OAuth2 Proxy Logger (Debug utility that proxies interfaces and logs)] ( https://github.com/aubelsb2/oauth2-logger-proxy )
178+ - [ OAuth2 Proxy Logger (Debug utility that proxies interfaces and logs)] ( https://github.com/aubelsb2/oauth2-logger-proxy )
179179
180180## MIT License
181181
182- Copyright (c) 2016 Lyric
182+ Copyright (c) 2016 Lyric
183183
184- [ Build-Status-Url ] : https://travis-ci.org/go-oauth2/oauth2
185- [ Build-Status-Image ] : https://travis-ci.org/go-oauth2/oauth2.svg?branch=master
184+ [ build-status-url ] : https://travis-ci.org/go-oauth2/oauth2
185+ [ build-status-image ] : https://travis-ci.org/go-oauth2/oauth2.svg?branch=master
186186[ codecov-url ] : https://codecov.io/gh/go-oauth2/oauth2
187187[ codecov-image ] : https://codecov.io/gh/go-oauth2/oauth2/branch/master/graph/badge.svg
188188[ reportcard-url ] : https://goreportcard.com/report/github.com/go-oauth2/oauth2/v4
0 commit comments