mirror of
https://github.com/wahyd4/loginsrv.git
synced 2026-08-09 12:56:06 +10:00
25 lines
752 B
Go
25 lines
752 B
Go
package osiam
|
|
|
|
import (
|
|
"github.com/tarent/loginsrv/logging"
|
|
"github.com/tarent/loginsrv/login"
|
|
)
|
|
|
|
// OsiamProviderName const with the name of the provider
|
|
const OsiamProviderName = "osiam"
|
|
|
|
func init() {
|
|
login.RegisterProvider(
|
|
&login.ProviderDescription{
|
|
Name: OsiamProviderName,
|
|
HelpText: "Osiam login backend opts: endpoint=..,client_id=..,client_secret=..",
|
|
},
|
|
func(config map[string]string) (login.Backend, error) {
|
|
if config["clientId"] != "" {
|
|
logging.Logger.Warn("DEPRECATED: please use 'client_id' and 'client_secret' in future.")
|
|
return NewBackend(config["endpoint"], config["clientId"], config["clientSecret"])
|
|
}
|
|
return NewBackend(config["endpoint"], config["client_id"], config["client_secret"])
|
|
})
|
|
}
|