1
0
mirror of https://github.com/oauth2-proxy/oauth2-proxy.git synced 2025-01-10 04:18:14 +02:00
oauth2-proxy/providers/providers.go

23 lines
416 B
Go
Raw Normal View History

package providers
import (
"github.com/bitly/go-simplejson"
)
type Provider interface {
Data() *ProviderData
GetEmailAddress(auth_response *simplejson.Json,
access_token string) (string, error)
}
func New(provider string, p *ProviderData) Provider {
switch provider {
2015-03-31 21:17:17 +02:00
case "myusa":
return NewMyUsaProvider(p)
2015-04-18 00:33:17 +02:00
case "linkedin":
return NewLinkedInProvider(p)
default:
return NewGoogleProvider(p)
}
}