Skip to content

Latest commit

 

History

History
49 lines (33 loc) · 1002 Bytes

README.md

File metadata and controls

49 lines (33 loc) · 1002 Bytes

Postgres Storage for OAuth 2.0

GoDoc License

Install

$ go get -v github.com/JonathanMonga/go-oauth2-postgres

Usage

package main

import (
	"github.com/JonathanMonga/go-oauth2-postgres"
	"github.com/go-oauth2/oauth2/v4/manage"

	_ "github.com/lib/pq"
)

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

	// use postgres token store
	store := postgres.NewDefaultStore(
		postgres.NewConfig("postgres://postgres:password@localhost/myapp_test?sslmode=disable"),
	)

	defer store.Close()

	manager.MapTokenStorage(store)
	// ...
}

MIT License

Copyright (c) 2023 Jonathan Monga