All Projects → go-oauth2 → redis

go-oauth2 / redis

Licence: MIT license
Redis storage for OAuth 2.0

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to redis

oauth2
A standalone OAuth2 & SSO server based on go-oauth2
Stars: ✭ 107 (+174.36%)
Mutual labels:  go-oauth2
oauth2
Interface oriented implementation, no coupling with the model and database, support for GC
Stars: ✭ 12 (-69.23%)
Mutual labels:  go-oauth2
Oauth2
OAuth 2.0 server library for the Go programming language.
Stars: ✭ 2,173 (+5471.79%)
Mutual labels:  go-oauth2

Redis Storage for OAuth 2.0

Build Codecov ReportCard GoDoc License

Install

$ go get -u -v github.com/go-oauth2/redis/v4

Usage

package main

import (
	"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
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].