We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6525c99 commit 6ec4b67Copy full SHA for 6ec4b67
1 file changed
djangosaml2/views.py
@@ -37,6 +37,7 @@
37
UnsolicitedResponse)
38
from saml2.s_utils import UnsupportedBinding
39
from saml2.sigver import MissingKey
40
+from saml2.samlp import AuthnRequest
41
from saml2.validate import ResponseLifetimeExceed, ToEarly
42
from saml2.xmldsig import ( # support for SHA1 is required by spec
43
SIG_RSA_SHA1, SIG_RSA_SHA256)
@@ -205,6 +206,9 @@ def login(request,
205
206
binding=binding,
207
**kwargs)
208
try:
209
+ if isinstance(request_xml, AuthnRequest):
210
+ # request_xml will be an instance of AuthnRequest if the message is not signed
211
+ request_xml = str(request_xml)
212
saml_request = base64.b64encode(bytes(request_xml, 'UTF-8')).decode('utf-8')
213
214
http_response = render(request, post_binding_form_template, {
0 commit comments