user authorization verification module
Deprecated. Use https://github.com/deweppro/go-sdk
go get -u github.com/deweppro/go-auth
see more here
import (
"github.com/deweppro/go-auth/config"
"github.com/deweppro/go-auth/providers"
)
var providerConfig = &config.Config{
Provider: []config.ConfigItem{
{
Code: "google",
ClientID: "****************.apps.googleusercontent.com",
ClientSecret: "****************",
RedirectURL: "https://example.com/oauth/callback/google",
},
},
}
providers := providers.New(providerConfig)
You can add our provider corresponding to the providers.IProvider
interface
providers.Add(provider1, provider2, ...)
import "github.com/deweppro/go-auth"
authServ := auth.New(providers)
the methods return an http handler func(http.ResponseWriter, *http.Request)
when called
// <provider name> - provider name from the config
authServ.Request(<provider name>)
authServ.CallBack(<provider name>, <callback function>)
<provider name>
- provider name from config<callback function>
- response results handler has signaturefunc(http.ResponseWriter, *http.Request, isp.IUser)
isp.IUser
- a new instance of the processed user model with ACL data filling
BSD-3-Clause License. See the LICENSE file for details.