# HG changeset patch # User paulb # Date 1195259416 0 # Node ID 5b68f06b8d2461fb149f44f79d8011020ddd552c # Parent a7072c65117074d2d20df185be91a39e197e95ee [project @ 2007-11-17 00:30:16 by paulb] Added a POST-based form to the success messages which permits the "HTML FORM Redirection" mode of indirect communication described in the "OpenID 2.0 Authentication" draft. diff -r a7072c651170 -r 5b68f06b8d24 WebStack/Resources/OpenIDInitiation.py --- a/WebStack/Resources/OpenIDInitiation.py Tue Nov 13 23:17:11 2007 +0000 +++ b/WebStack/Resources/OpenIDInitiation.py Sat Nov 17 00:30:16 2007 +0000 @@ -38,9 +38,9 @@ The optional 'openid_mode' parameter may be set to "checkid_immediate" or "checkid_setup" (the default). - If the optional 'use_redirect' flag is set to 0, a confirmation screen - is given instead of redirecting the user back to the original - application. + If the optional 'use_redirect' flag is set to a false value (which is + not the default), a confirmation screen is given instead of immediately + redirecting the user to the OpenID provider. The optional 'urlencoding' parameter allows a special encoding to be used in producing the redirection path. @@ -101,11 +101,11 @@ ) # Show the success page anyway. + # Offer a POST-based form for redirection. - self.show_success(trans, url) + self.show_success(trans, provider, app, claimed_identifier, local_identifier) # Redirect to the OpenID provider URL. - # NOTE: Offer a POST-based form for redirection. if self.use_redirect: trans.redirect(url) @@ -157,16 +157,19 @@ out = trans.get_response_stream() out.write(self.initiation_page % app) - def show_success(self, trans, url): + def show_success(self, trans, provider, app, claimed_identifier, local_identifier): """ Writes a success screen using the transaction 'trans', including details - of the OpenID provider 'url'. + of the OpenID 'provider', the 'app' URL, 'claimed_identifier' and + 'local_identifier'. """ trans.set_content_type(WebStack.Generic.ContentType("text/html", self.encoding)) out = trans.get_response_stream() - out.write(self.success_page % (url, url)) + out.write(self.success_page % ( + provider, self.openid_ns, self.openid_mode, app, claimed_identifier, local_identifier) + ) initiation_page = """ @@ -177,8 +180,8 @@