⬆️ Updated to v4 of oauth2

This commit is contained in:
李寻欢 2021-08-22 01:00:58 +08:00
parent 0d298614c9
commit 861b8524ed
5 changed files with 47 additions and 43 deletions

2
.gitignore vendored
View File

@ -1,3 +1,5 @@
.idea
# Compiled Object files, Static and Dynamic libs (Shared Objects)
*.o
*.a

View File

@ -2,7 +2,7 @@
> Using Gin framework implementation OAuth 2.0 services
[![License][License-Image]][License-Url] [![ReportCard][ReportCard-Image]][ReportCard-Url] [![GoDoc][GoDoc-Image]][GoDoc-Url]
[![License][license-image]][license-url] [![ReportCard][reportcard-image]][reportcard-url] [![GoDoc][godoc-image]][godoc-url]
## Quick Start
@ -21,11 +21,11 @@ import (
"net/http"
"github.com/gin-gonic/gin"
"github.com/go-oauth2/gin-server"
"gopkg.in/oauth2.v3/manage"
"gopkg.in/oauth2.v3/models"
"gopkg.in/oauth2.v3/server"
"gopkg.in/oauth2.v3/store"
"gitee.ltd/go-oauth2/gin-server"
"github.com/go-oauth2/oauth2/v4/manage"
"github.com/go-oauth2/oauth2/v4/models"
"github.com/go-oauth2/oauth2/v4/server"
"github.com/go-oauth2/oauth2/v4/store"
)
func main() {
@ -126,9 +126,9 @@ http://localhost:9096/api/test?access_token=AJPNSQO2PCITABYX0RFLWG
Copyright (c) 2016 Lyric
```
[License-Url]: http://opensource.org/licenses/MIT
[License-Image]: https://img.shields.io/npm/l/express.svg
[ReportCard-Url]: https://goreportcard.com/report/github.com/go-oauth2/gin-server
[ReportCard-Image]: https://goreportcard.com/badge/github.com/go-oauth2/gin-server
[GoDoc-Url]: https://godoc.org/github.com/go-oauth2/gin-server
[GoDoc-Image]: https://godoc.org/github.com/go-oauth2/gin-server?status.svg
[license-url]: http://opensource.org/licenses/MIT
[license-image]: https://img.shields.io/npm/l/express.svg
[reportcard-url]: https://goreportcard.com/report/github.com/go-oauth2/gin-server
[reportcard-image]: https://goreportcard.com/badge/github.com/go-oauth2/gin-server
[godoc-url]: https://godoc.org/github.com/go-oauth2/gin-server
[godoc-image]: https://godoc.org/github.com/go-oauth2/gin-server?status.svg

View File

@ -1,8 +1,8 @@
package ginserver
import (
"gopkg.in/oauth2.v3"
"gopkg.in/oauth2.v3/server"
"github.com/go-oauth2/oauth2/v4"
"github.com/go-oauth2/oauth2/v4/server"
)
// SetTokenType token type

View File

@ -1,14 +1,16 @@
package main
import (
ginserver "gin-server"
"net/http"
"gitee.ltd/go-oauth2/gin-server"
"github.com/gin-gonic/gin"
"github.com/go-oauth2/gin-server"
"gopkg.in/oauth2.v3/manage"
"gopkg.in/oauth2.v3/models"
"gopkg.in/oauth2.v3/server"
"gopkg.in/oauth2.v3/store"
"github.com/go-oauth2/oauth2/v4/manage"
"github.com/go-oauth2/oauth2/v4/models"
"github.com/go-oauth2/oauth2/v4/server"
"github.com/go-oauth2/oauth2/v4/store"
)
func main() {

View File

@ -5,8 +5,8 @@ import (
"sync"
"github.com/gin-gonic/gin"
"gopkg.in/oauth2.v3"
"gopkg.in/oauth2.v3/server"
"github.com/go-oauth2/oauth2/v4"
"github.com/go-oauth2/oauth2/v4/server"
)
var (