Mongo Storage for OAuth 2.0
$ go get -u -v gopkg.in/go-oauth2/mongo.v3
package main
import (
"gopkg.in/go-oauth2/mongo.v3"
"gopkg.in/oauth2.v3/manage"
)
func main() {
manager := manage.NewDefaultManager()
// use mongodb token store
manager.MapTokenStorage(
mongo.NewTokenStore(mongo.NewConfig(
"mongodb://127.0.0.1:27017",
"oauth2",
)),
)
// ...
}
Copyright (c) 2016 Lyric