1
0
mirror of https://github.com/oauth2-proxy/oauth2-proxy.git synced 2025-06-02 23:27:22 +02:00
oauth2-proxy/providers/providers.go

22 lines
484 B
Go
Raw Normal View History

package providers
type Provider interface {
Data() *ProviderData
2015-05-20 23:23:48 -04:00
GetEmailAddress(body []byte, access_token string) (string, error)
Redeem(string, string) ([]byte, string, error)
2015-05-12 21:48:13 -04:00
ValidateToken(access_token string) bool
}
func New(provider string, p *ProviderData) Provider {
switch provider {
2015-03-31 15:17:17 -04:00
case "myusa":
return NewMyUsaProvider(p)
2015-04-17 15:33:17 -07:00
case "linkedin":
return NewLinkedInProvider(p)
2015-05-20 23:23:48 -04:00
case "github":
return NewGitHubProvider(p)
default:
return NewGoogleProvider(p)
}
}