modulepackage
3.2.2
Repository: https://github.com/mteeeur/go-oauth2-mongo.git
Documentation: pkg.go.dev
# README
Mongo Storage for OAuth 2.0
Install
$ go get -u -v gopkg.in/go-oauth2/mongo.v3
Usage
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",
)),
)
// ...
}
MIT License
Copyright (c) 2016 Lyric
# Functions
NewClientStore create a client store instance based on mongodb.
NewClientStoreWithSession create a client store instance based on mongodb.
NewConfig create mongodb configuration.
NewDefaultClientConfig create a default client configuration.
NewDefaultTokenConfig create a default token configuration.
NewTokenStore create a token store instance based on mongodb.
NewTokenStoreWithSession create a token store instance based on mongodb.
# Structs
ClientConfig client configuration parameters.
ClientStore MongoDB storage for OAuth 2.0.
Config mongodb configuration parameters.
TokenConfig token configuration parameters.
TokenStore MongoDB storage for OAuth 2.0.