POST binding javascript malformed

Bug #1012428 reported by Jan Vilhuber
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pySAML2
New
Undecided
Unassigned

Bug Description

I've tried two metadata files I have so far, and generated the POST-binding form, and it resulted in:

<head>
<title>SAML 2.0 POST</title>
</head><body>
<form method="post" etc etc etc...
</form>
<script type="text/javascript">
     window.onload = function ()
 { document.forms[0].submit();
</script>
</body>

Notice the javascript is missing a closing paren. Firebug reports: missing } after function body

Revision history for this message
Jan Vilhuber (8foisk-jan-ugqehg) wrote :

This is using the latest 0.4.2, python 2.7.
snip:
            binding = saml2.BINDING_HTTP_POST
            result = self.client.authenticate(
                                              entityid=i,
                                              relay_state="",
                                              binding=binding,
                                              log=logger,
                                              vorg="",
                                              scoping=None,
                                              sign=False)

Revision history for this message
Jan Vilhuber (8foisk-jan-ugqehg) wrote :

Looks line the bug is here:
http://bazaar.launchpad.net/~pysaml2maint/pysaml2/main/view/head:/src/saml2/binding.py
Line 67:

    response.append(" { document.forms[0].submit(); ")

should be

    response.append(" { document.forms[0].submit(); }")

Revision history for this message
Roland Hedberg (roland-hedberg) wrote : Re: [Bug 1012428] POST binding javascript malformed

Thanks Jan !

I've pushed a fix.
Please notice that this only appears in the github repo (https://github.com/rohe/pysaml2) since that is where the newest code is kept.

13 jun 2012 kl. 02:19 skrev Jan Vilhuber:

> Looks line the bug is here:
> http://bazaar.launchpad.net/~pysaml2maint/pysaml2/main/view/head:/src/saml2/binding.py
> Line 67:
>
> response.append(" { document.forms[0].submit(); ")
>
> should be
>
> response.append(" { document.forms[0].submit(); }")

-- Roland
------------------------------------------------------
Roland Hedberg
IT Architect/Senior Researcher
ICT Services and System Development (ITS)
Umeå University
SE-901 87 Umeå, Sweden
Phone +46 90 786 68 44
Mobile +46 70 696 68 44
www.its.umu.se

Revision history for this message
Jan Vilhuber (8foisk-jan-ugqehg) wrote :

Just noticed something else:

https://github.com/rohe/pysaml2/blob/master/src/saml2/client.py#L388

Shouldn't binding be passed in here? If I use an HTTP POST binding,
and I pass this into the caller, it is not passed in HERE, and thus we
look for an HTTP REDIRECT binding (which my particular metadata I'm
testing with doesn't have).

Regards, and thanks for the fast response.
jan

On Wed, Jun 13, 2012 at 12:25 AM, Roland Hedberg
<email address hidden> wrote:
> Thanks Jan !
>
> I've pushed a fix.
> Please notice that this only appears in the github repo (https://github.com/rohe/pysaml2) since that is where the newest code is kept.
>
> 13 jun 2012 kl. 02:19 skrev Jan Vilhuber:
>
>> Looks line the bug is here:
>> http://bazaar.launchpad.net/~pysaml2maint/pysaml2/main/view/head:/src/saml2/binding.py
>> Line 67:
>>
>>    response.append(" { document.forms[0].submit(); ")
>>
>> should be
>>
>>    response.append(" { document.forms[0].submit(); }")
>
> -- Roland
> ------------------------------------------------------
> Roland Hedberg
> IT Architect/Senior Researcher
> ICT Services and System Development (ITS)
> Umeå University
> SE-901 87 Umeå, Sweden
> Phone +46 90 786 68 44
> Mobile +46 70 696 68 44
> www.its.umu.se
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1012428
>
> Title:
>  POST binding javascript malformed
>
> Status in Python implementation of SAML2:
>  New
>
> Bug description:
>  I've tried two metadata files I have so far, and generated the POST-
>  binding form, and it resulted in:
>
>  <head>
>  <title>SAML 2.0 POST</title>
>  </head><body>
>  <form method="post" etc etc etc...
>  </form>
>  <script type="text/javascript">
>       window.onload = function ()
>   { document.forms[0].submit();
>  </script>
>  </body>
>
>
>  Notice the javascript is missing a closing paren. Firebug reports: missing } after function body
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/pysaml2/+bug/1012428/+subscriptions

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.