MCPcopy
hub / github.com/oauth2-proxy/oauth2-proxy / NewADFSProvider

Function NewADFSProvider

providers/adfs.go:33–58  ·  view source on GitHub ↗

NewADFSProvider initiates a new ADFSProvider

(p *ProviderData, opts options.Provider)

Source from the content-addressed store, hash-verified

31
32// NewADFSProvider initiates a new ADFSProvider
33func NewADFSProvider(p *ProviderData, opts options.Provider) *ADFSProvider {
34 p.setProviderDefaults(providerDefaults{
35 name: adfsProviderName,
36 scope: adfsDefaultScope,
37 })
38
39 if p.ProtectedResource != nil && p.ProtectedResource.String() != "" {
40 resource := p.ProtectedResource.String()
41 if !strings.HasSuffix(resource, "/") {
42 resource += "/"
43 }
44
45 if p.Scope != "" && !strings.HasPrefix(p.Scope, resource) {
46 p.Scope = resource + p.Scope
47 }
48 }
49
50 oidcProvider := NewOIDCProvider(p, opts.OIDCConfig)
51
52 return &ADFSProvider{
53 OIDCProvider: oidcProvider,
54 skipScope: ptr.Deref(opts.ADFSConfig.SkipScope, options.DefaultADFSSkipScope),
55 oidcEnrichFunc: oidcProvider.EnrichSession,
56 oidcRefreshFunc: oidcProvider.RefreshSession,
57 }
58}
59
60// GetLoginURL Override to double encode the state parameter. If not query params are lost
61// More info here: https://docs.microsoft.com/en-us/powerapps/maker/portals/configure/configure-saml2-settings

Callers 3

NewProviderFunction · 0.85
testADFSProviderFunction · 0.85
adfs_test.goFile · 0.85

Calls 4

DerefFunction · 0.92
NewOIDCProviderFunction · 0.85
setProviderDefaultsMethod · 0.80
StringMethod · 0.45

Tested by 1

testADFSProviderFunction · 0.68