Commit 994296d
fix: prep_for_nego_auth: avoid double signing redirect requests
Fixes #819 (again)
The prepare_for_negotiated_authenticate method has sign parameter defaulting to None.
The logic setting sign_redirect and sign_post does not properly handle the three-state aspects
that sign has with None mixed True and False.
Python evalutes `None and <any value>` as None, so as a result,
None gets passed forboth sign_redirect and sign_post.
However, None is interpreted by Entity._message as "sign if self.should_sign".
As a result, for Redirect binding, the authentication request gets signed
both in XML and in HTTP parameter (recurrence of #819).
Fix this by passing an explicit False for exactly one of the branches
(sign_post for REDIRECT binding and sign_redirect for all other bindings),
passing through value of `sign` for the other branch.1 parent 0252ec9 commit 994296d
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
147 | | - | |
148 | | - | |
| 147 | + | |
| 148 | + | |
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
| |||
0 commit comments