A storage backend for osin oauth2 with:
This project was inspired from ory-am
- Save map and struct meta information with
JSON
(orJSONB
) for Client and Authorization - Use
SaveClient()
instead ofCreateClient()
andUpdateClient()
- Add
AllClients() []
interface for management - Add remember function for authorization
cat storage/database/oauth_schema.sql | docker exec -i osin-db psql -U osin
import (
"database/sql"
_ "github.com/lib/pq"
"github.com/liut/osin-storage/storage/sqlstore"
"github.com/openshift/osin"
)
func main () {
dsn := "postgres://osin:osin@127.0.0.1:5432/osin?sslmode=disable"
db, err := sql.Open("postgres", dsn)
if err != nil {
log.Fatal(err)
}
store := sqlstore.New(db)
server := osin.NewServer(newOsinConfig(), store)
}