Changeset 4092 for waeup


Ignore:
Timestamp:
26 Apr 2009, 12:07:48 (16 years ago)
Author:
uli
Message:

Update tests.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • waeup/branches/ulif-rewrite/src/waeup/authentication.txt

    r4086 r4092  
    2424  >>> browser.handleErrors = False
    2525
    26 Accessing the front page
    27 ========================
     26Creating users (principals)
     27===========================
     28
     29Before we can login, we have to provide a user (``principal`` in Zope
     30terms). On the API level we can so by looking up a
     31UserAuthenticationUtility named ``users``:
     32
     33  >>> from zope.component import getUtility
     34  >>> from zope.app.authentication.interfaces import IAuthenticatorPlugin
     35  >>> authenticator = getUtility(IAuthenticatorPlugin, name=u'users')
     36
     37This plugin also enables us to add new users. At least a username and
     38a password is required:
     39
     40  >>> authenticator.addUser('bob', 'bobssecret')
     41
     42We can also add complete `Account` objects. An `Account` stores the
     43user credentials and some metadata persistently:
     44
     45  >>> from waeup.authentication import Account
     46  >>> alice = Account('alice', 'alicesecret')
     47  >>> authenticator.addAccount(alice)
     48
     49
     50Logging in via side bar
     51=======================
    2852
    2953We can access the front page without restrictions:
     
    3357  200 Ok
    3458
    35 There is a login form on the fron page sidebar:
     59There is a login form on the front page sidebar:
    3660
    3761  >>> 'form.login' in browser.contents
     
    4367  >>> browser.getControl(name='form.password').value = 'grok'
    4468  >>> browser.getControl('Login').click()
     69
Note: See TracChangeset for help on using the changeset viewer.