Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/go-oauth2/redis
Redis storage for OAuth 2.0
https://github.com/go-oauth2/redis
go-oauth2 go-oauth2-redis
Last synced: 4 days ago
JSON representation
Redis storage for OAuth 2.0
- Host: GitHub
- URL: https://github.com/go-oauth2/redis
- Owner: go-oauth2
- License: mit
- Created: 2016-07-23T01:04:14.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-04-22T20:42:03.000Z (7 months ago)
- Last Synced: 2024-10-01T15:09:57.650Z (about 1 month ago)
- Topics: go-oauth2, go-oauth2-redis
- Language: Go
- Homepage: https://godoc.org/gopkg.in/go-oauth2/redis.v3
- Size: 41 KB
- Stars: 50
- Watchers: 4
- Forks: 35
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ccamel - go-oauth2/redis - Redis storage for OAuth 2.0 (Go)
README
# Redis Storage for [OAuth 2.0](https://github.com/go-oauth2/oauth2)
[![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]
## Install
``` bash
$ go get -u -v github.com/go-oauth2/redis/v4
```## Usage
``` go
package mainimport (
"github.com/go-redis/redis/v8"
oredis "github.com/go-oauth2/redis/v4"
"github.com/go-oauth2/oauth2/v4/manage"
)func main() {
manager := manage.NewDefaultManager()
// use redis token store
manager.MapTokenStorage(oredis.NewRedisStore(&redis.Options{
Addr: "127.0.0.1:6379",
DB: 15,
}))// use redis cluster store
// manager.MapTokenStorage(oredis.NewRedisClusterStore(&redis.ClusterOptions{
// Addrs: []string{"127.0.0.1:6379"},
// DB: 15,
// }))
}
```## MIT License
```
Copyright (c) 2020 Lyric
```[Build-Status-Url]: https://travis-ci.org/go-oauth2/redis
[Build-Status-Image]: https://travis-ci.org/go-oauth2/redis.svg?branch=master
[codecov-url]: https://codecov.io/gh/go-oauth2/redis
[codecov-image]: https://codecov.io/gh/go-oauth2/redis/branch/master/graph/badge.svg
[reportcard-url]: https://goreportcard.com/report/github.com/go-oauth2/redis/v4
[reportcard-image]: https://goreportcard.com/badge/github.com/go-oauth2/redis/v4
[godoc-url]: https://godoc.org/github.com/go-oauth2/redis/v4
[godoc-image]: https://godoc.org/github.com/go-oauth2/redis/v4?status.svg
[license-url]: http://opensource.org/licenses/MIT
[license-image]: https://img.shields.io/npm/l/express.svg