~ubuntuone-pqm-team/canonical-identity-provider/trunk

« back to all changes in this revision

Viewing changes to doctests/stories/openid/offsite-form-post.txt

  • Committer: Danny Tamez
  • Date: 2010-04-21 15:29:24 UTC
  • Revision ID: danny.tamez@canonical.com-20100421152924-lq1m92tstk2iz75a
Canonical SSO Provider (Open Source) - Initial Commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Copyright 2010 Canonical Ltd.  This software is licensed under the
 
2
GNU Affero General Public License version 3 (see the file LICENSE).
 
3
 
 
4
== Posts to the OpenID endpoint ==
 
5
 
 
6
The OpenID 2.0 protocol allows authentication requests to be made via
 
7
form posts.  Such requests appear to be off-site form posts.  We
 
8
explicitly allow POST requests through to the OpenID endpoint:
 
9
 
 
10
  >>> from urllib import urlencode
 
11
  >>> browser = setupBrowser("Basic no-priv@canonical.com:test")
 
12
  >>> browser.mech_browser.set_handle_referer(False)
 
13
  >>> browser.addHeader("Referer", 'http://relying-party.com/')
 
14
  >>> browser.handleErrors = True
 
15
  >>> browser.open('http://openid.launchpad.dev/+openid', data=urlencode({
 
16
  ...    'openid.mode': 'no-such-method'}))
 
17
  >>> print browser.url
 
18
  http://openid.launchpad.dev/+openid
 
19
  >>> print browser.contents
 
20
  error:...'no-such-method'
 
21
  mode:error
 
22
  <BLANKLINE>