MySQL Storage for OAuth 2.0
$ go get -v github.com/go-oauth2/mysql/v4
package main
import (
"github.com/go-oauth2/mysql/v4"
"github.com/go-oauth2/oauth2/v4/manage"
_ "github.com/go-sql-driver/mysql"
)
func main() {
manager := manage.NewDefaultManager()
// use mysql token store
store := mysql.NewDefaultStore(
mysql.NewConfig("root:123456@tcp(127.0.0.1:3306)/myapp_test?charset=utf8"),
)
defer store.Close()
manager.MapTokenStorage(store)
// ...
}
Copyright (c) 2018 Lyric