File tree Expand file tree Collapse file tree 4 files changed +23
-3
lines changed Expand file tree Collapse file tree 4 files changed +23
-3
lines changed Original file line number Diff line number Diff line change 1+ < script type ="text/javascript "{% if request.csp_nonce %} nonce ="{{ request.csp_nonce }} "{% endif %} >
2+ window . onload = function ( ) {
3+ document . SSO_Login . submit ( ) ;
4+ } ;
5+ </ script >
6+ < p >
7+ You're being redirected to a SSO login page.
8+ Please click the button below if you're not redirected automatically within a few seconds.
9+ </ p >
10+ < form method ="post " action ="{{ target_url }} " name ="SSO_Login ">
11+ {% for key, value in params.items %}
12+ < input type ="hidden " name ="{{ key }} " value ="{{ value }} " />
13+ {% endfor %}
14+ < input type ="submit " value ="Log in " />
15+ </ form >
Original file line number Diff line number Diff line change @@ -257,6 +257,6 @@ def _django_csp_update_decorator():
257257 )
258258 return
259259 else :
260- # script-src 'unsafe-inline' to autosubmit forms,
260+ # autosubmit of forms uses nonce per default
261261 # form-action https: to send data to IdPs
262- return csp_update (SCRIPT_SRC = [ "'unsafe-inline'" ], FORM_ACTION = ["https:" ])
262+ return csp_update (FORM_ACTION = ["https:" ])
Original file line number Diff line number Diff line change @@ -34,6 +34,11 @@ guides: djangosaml2 will automatically blend in and update the headers for
3434POST-bindings, so you must not include exceptions for djangosaml2 in your
3535global configuration.
3636
37+ Note that to enable autosubmit of post-bindings inline-javascript is used. To
38+ allow execution of this autosubmit-code a nonce is included, which works in
39+ default configuration but may not work if you modify ` CSP_INCLUDE_NONCE_IN `
40+ to exclude ` script-src ` .
41+
3742You can specify a custom CSP handler via the ` SAML_CSP_HANDLER ` setting and the
3843warning can be disabled by setting ` SAML_CSP_HANDLER='' ` . See the
3944[ djangosaml2] ( https://djangosaml2.readthedocs.io/ ) documentation for more
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ def read(*rnames):
2727
2828setup (
2929 name = "djangosaml2" ,
30- version = "1.9.2 " ,
30+ version = "1.9.3 " ,
3131 description = "pysaml2 integration for Django" ,
3232 long_description = read ("README.md" ),
3333 long_description_content_type = "text/markdown" ,
You can’t perform that action at this time.
0 commit comments