fix: use configured binding on SAML IDPs and make sure CSP doesn't block POST binding (#7341)

fix: use configured binding on SAML IDPs and make sure CSP doesn't block POST binding
This commit is contained in:
Livio Spring 2024-02-05 15:45:15 +01:00 committed by GitHub
parent c081f72d85
commit 7f7fb55f34
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 1 deletions

View File

@ -105,7 +105,7 @@ func csp() *middleware.CSP {
csp := middleware.DefaultSCP csp := middleware.DefaultSCP
csp.ObjectSrc = middleware.CSPSourceOptsSelf() csp.ObjectSrc = middleware.CSPSourceOptsSelf()
csp.StyleSrc = csp.StyleSrc.AddNonce() csp.StyleSrc = csp.StyleSrc.AddNonce()
csp.ScriptSrc = csp.ScriptSrc.AddNonce() csp.ScriptSrc = csp.ScriptSrc.AddNonce().AddHash("sha256", "AjPdJSbZmeWHnEc5ykvJFay8FTWeTeRbs9dutfZ0HqE=")
return &csp return &csp
} }

View File

@ -159,6 +159,9 @@ func (p *Provider) GetSP() (*samlsp.Middleware, error) {
if p.requestTracker != nil { if p.requestTracker != nil {
sp.RequestTracker = p.requestTracker sp.RequestTracker = p.requestTracker
} }
if p.binding != "" {
sp.Binding = p.binding
}
return sp, nil return sp, nil
} }