Skip to content

Commit 3cedd0b

Browse files
e271828-c00kiemon5ter
authored andcommitted
Add note to docs on debugging responses
Signed-off-by: Ivan Kanakarakis <[email protected]>
1 parent 20000a7 commit 3cedd0b

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

Diff for: docs/howto/index.rst

+8-8
Original file line numberDiff line numberDiff line change
@@ -6,35 +6,35 @@ How to use PySAML2
66
:Release: |release|
77
:Date: |today|
88

9-
Before you can use Pysaml2, you'll need to get it installed.
9+
Before you can use Pysaml2, you'll need to get it installed.
1010
If you have not done it yet, read the :ref:`install`
1111

1212
Well, now you have it installed and you want to do something.
1313

14-
And I'm sorry to tell you this; but there isn't really a lot you can do with
14+
And I'm sorry to tell you this; but there isn't really a lot you can do with
1515
this code on its own.
1616

17-
Sure you can send a AuthenticationRequest to an IdentityProvider or a
17+
Sure you can send a AuthenticationRequest to an IdentityProvider or a
1818
AttributeQuery to an AttributeAuthority, but in order to get what they
1919
return you have to sit behind a Web server. Well that is not really true since
2020
the AttributeQuery would be over SOAP and you would get the result over the
2121
connection you have to the AttributeAuthority.
2222

23-
But anyway, you may get my point. This is middleware stuff !
23+
But anyway, you may get my point. This is middleware stuff!
2424

25-
PySAML2 is built to fit into a
25+
PySAML2 is built to fit into a
2626
`WSGI <http://www.python.org/dev/peps/pep-0333/>`_ application
2727

28-
But it can be used in a non-WSGI environment too.
28+
But it can be used in a non-WSGI environment too.
2929

3030
So you will find descriptions of both cases here.
3131

32-
The configuration is the same regardless of whether you are using PySAML2 in a
32+
The configuration is the same regardless of whether you are using PySAML2 in a
3333
WSGI or non-WSGI environment.
3434

3535
.. toctree::
3636
:maxdepth: 1
3737

3838
config
3939

40-
40+

Diff for: src/saml2/response.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ def _verify(self):
413413
self.response.destination
414414
and self.response.destination not in self.return_addrs
415415
):
416-
logger.error("%s not in %s", self.response.destination, self.return_addrs)
416+
logger.error("destination '%s' not in return addresses '%s'", self.response.destination, self.return_addrs)
417417
return None
418418

419419
valid = self.issue_instant_ok() and self.status_ok()
@@ -737,6 +737,10 @@ def _holder_of_key_confirmed(self, data):
737737
def get_subject(self):
738738
""" The assertion must contain a Subject
739739
"""
740+
741+
if not self.assertion:
742+
raise ValueError("Missing assertion")
743+
740744
if not self.assertion.subject:
741745
raise ValueError(
742746
"Invalid assertion subject: {subject}".format(

0 commit comments

Comments
 (0)