Categorygithub.com/DataChassis/go-oauth2-couchdb
modulepackage
0.1.3
Repository: https://github.com/datachassis/go-oauth2-couchdb.git
Documentation: pkg.go.dev

# README

CouchDB Storage for OAuth 2.0

Install

$ go get github.com/DataChassis/go-oauth2-couchdb

Usage

package main

import (
	couchdb "github.com/DataChassis/go-oauth2-couchdb"
	"github.com/go-oauth2/oauth2/manage"
)

func main() {
	manager := manage.NewDefaultManager()

	// use couchdb token store
	tokenConfig := couchdb.NewConfig("http://localhost:5984", "oauth2-tokens", "username", "password")
	manager.MapTokenStorage(couchdb.NewTokenStore(tokenConfig))

	// use couchdb client store
	clientConfig := couchdb.NewConfig("http://localhost:5984", "oauth2-clients", "username", "password")
	manager.MapClientStorage(couchdb.NewClientStore(clientConfig))

	// ...
}

MIT License

Copyright (c) 2022 Data Chassis Ltd
Portions 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 CouchDB storage for OAuth 2.0.
Config mongodb configuration parameters.
TokenConfig token configuration parameters.
TokenStore CouchDB storage for OAuth 2.0.