mirror of
https://github.com/oauth2-proxy/oauth2-proxy.git
synced 2025-01-10 04:18:14 +02:00
25 lines
735 B
Go
25 lines
735 B
Go
package providers
|
|
|
|
import "github.com/oauth2-proxy/oauth2-proxy/v7/pkg/apis/options"
|
|
|
|
// NextcloudProvider represents an Nextcloud based Identity Provider
|
|
type NextcloudProvider struct {
|
|
*ProviderData
|
|
}
|
|
|
|
var _ Provider = (*NextcloudProvider)(nil)
|
|
|
|
const nextCloudProviderName = "Nextcloud"
|
|
|
|
// NewNextcloudProvider initiates a new NextcloudProvider
|
|
func NewNextcloudProvider(p *ProviderData) *NextcloudProvider {
|
|
p.ProviderName = nextCloudProviderName
|
|
p.getAuthorizationHeaderFunc = makeOIDCHeader
|
|
if p.EmailClaim == options.OIDCEmailClaim {
|
|
// This implies the email claim has not been overridden, we should set a default
|
|
// for this provider
|
|
p.EmailClaim = "ocs.data.email"
|
|
}
|
|
return &NextcloudProvider{ProviderData: p}
|
|
}
|