#94 Enable OIDC autosubmit and urlencode return url
Merged 7 years ago by puiterwijk. Opened 7 years ago by puiterwijk.
puiterwijk/ipsilon use-urlencode  into  master

@@ -19,6 +19,7 @@ 

  import requests

  import time

  import json

+ import urllib

  from urlparse import urlparse

  

  URLROOT = 'openidc'
@@ -98,7 +99,6 @@ 

          # Build a response-string, which is sent with either query, form

          # or fragment responses

          if response_mode in ['query', 'fragment']:

-             data = ['%s=%s' % (key, contents[key]) for key in contents.keys()]

  

              separator = '?'

              if response_mode == 'fragment':
@@ -108,7 +108,7 @@ 

              else:

                  url += '&'

  

-             url += '&'.join(data)

+             url += urllib.urlencode(contents)

  

          if response_mode in ['query', 'fragment', 'none']:

              raise cherrypy.HTTPRedirect(url)

@@ -17,7 +17,6 @@ 

  </div>

  

  <script type="text/javascript">

-   // TODO: Uncomment this, this is used for testing

-   //document.getElementById('openidc_response_form').submit();

+   document.getElementById('openidc_response_form').submit();

Is this executed everytime the page is loaded?

Yep. Because the only goal of this page is to submit the information back to the Relying Party.
This will make it a more seamless experience for the user.

Should we wait for the page to be fully loaded?

Well, the form is the only thing that matters for this script, and it's in front of this in the html file.

  </script>

  {% endblock %}

no initial comment

Is this executed everytime the page is loaded?

Yep. Because the only goal of this page is to submit the information back to the Relying Party.
This will make it a more seamless experience for the user.

Should we wait for the page to be fully loaded?

One question, otherwise :thumbsup: for me

Well, the form is the only thing that matters for this script, and it's in front of this in the html file.

Thanks for your answer, my :thumbsup: remains :)

rebased

7 years ago

Pull-Request has been merged by puiterwijk

7 years ago