Categorygithub.com/p000ic/go-oauth2-mongo
modulepackage
0.1.7
Repository: https://github.com/p000ic/go-oauth2-mongo.git
Documentation: pkg.go.dev

# README

Mongo Storage for OAuth 2.0 V4

golang > / = 1.16

Install

go get -u -v github.com/initial-commit-hq/go-oauth2-mongo

Usage

package main

import (
 "github.com/p000ic/go-oauth2-mongo"
 "github.com/go-oauth2/oauth2/v4/manage"
)

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

 // use mongodb token store
 manager.MapTokenStorage(mongo.NewTokenStore(
   mongo.NewConfig(
  "mongodb://127.0.0.1:27017", 
  "oauth2", 
  username, 
  password, 
  "oauth2")),
 )
 // ...
}

MIT License

Copyright (c) 2022 p000ic

# 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.