Code documentation

pyramid_persona Package


Include persona settings into a pyramid config.

This function does the following:

  • Setup default authentication and authorization policies, and a default session factory. Keep in mind that the sessions are not encrypted, if you need to store secret information in it, please override the session factory.

  • Add two request attributes :
    • persona_js, the javascript code to inclue on a page to make persona work.
    • persona_button, the html for a default login/logout button.
  • Set login and logout views for use with persona.

  • Set a forbidden view with a loggin button

views Module


A basic 403 view, with a login button


View to check the persona assertion and remember the user


View to forget the user


Verifies the assertion and the csrf token in the given request.

Returns the email of the user if everything is valid, otherwise raises a HTTPBadRequest

utils Module


If the user is logged in, returns the logout button, otherwise returns the login button


Returns the javascript needed to run persona