Package madrona :: Package openid :: Module views
[hide private]

Module views

source code

Functions [hide private]
 
_build_context(request, extra_context=None) source code
 
ask_openid(request, openid_url, redirect_to, on_failure=None)
basic function to ask openid and return response
source code
 
complete(request, on_success=None, on_failure=None, return_to=None, **kwargs)
complete openid signin
source code
 
default_on_success(request, identity_url, openid_response, **kwargs)
default action on openid signin success
source code
 
default_on_failure(request, message, **kwargs)
default failure action on signin
source code
 
not_authenticated(func)
decorator that redirect user to next page if he is already logged.
source code
 
signin_success(request, identity_url, openid_response, redirect_field_name=REDIRECT_FIELD_NAME, **kwargs)
openid signin success.
source code
 
signin_failure(request, message, template_name='authopenid/signin.html', redirect_field_name=REDIRECT_FIELD_NAME, openid_form=OpenidSigninForm, auth_form=AuthenticationForm, extra_context=None, **kwargs)
falure with openid signin.
source code
 
signin(request, template_name='authopenid/signin.html', redirect_field_name=REDIRECT_FIELD_NAME, openid_form=OpenidSigninForm, auth_form=AuthenticationForm, on_failure=None, extra_context=None)
Signin page.
source code
 
complete_signin(request, redirect_field_name=REDIRECT_FIELD_NAME, openid_form=OpenidSigninForm, auth_form=AuthenticationForm, on_success=signin_success, on_failure=signin_failure, extra_context=None)
in case of complete signin with openid
source code
 
is_association_exist(openid_url)
test if an openid is already in database
source code
 
register_account(form, _openid)
create an account
source code
 
register(request, template_name='authopenid/complete.html', redirect_field_name=REDIRECT_FIELD_NAME, register_form=OpenidRegisterForm, auth_form=AuthenticationForm, register_account=register_account, send_email=True, extra_context=None)
register an openid.
source code
 
signout(request, next_page=None, template_name='registration/logged_out.html')
signout from the website.
source code
 
xrdf(request, template_name='authopenid/yadis.xrdf')
view used to process the xrdf file
source code
 
password_change(request, template_name='authopenid/password_change_form.html', set_password_form=SetPasswordForm, change_password_form=PasswordChangeForm, post_change_redirect=None, extra_context=None)
View that allow a user to add a password to its account or change it.
source code
 
associate_failure(request, message, template_failure="authopenid/associate.html", openid_form=AssociateOpenID, redirect_name=None, extra_context=None, **kwargs)
function used when new openid association fail
source code
 
associate_success(request, identity_url, openid_response, redirect_field_name=REDIRECT_FIELD_NAME, send_email=True, **kwargs)
function used when new openid association success.
source code
 
complete_associate(request, redirect_field_name=REDIRECT_FIELD_NAME, template_failure='authopenid/associate.html', openid_form=AssociateOpenID, redirect_name=None, on_success=associate_success, on_failure=associate_failure, send_email=True, extra_context=None)
in case of complete association with openid
source code
 
associate(request, template_name='authopenid/associate.html', openid_form=AssociateOpenID, redirect_field_name=REDIRECT_FIELD_NAME, on_failure=associate_failure, extra_context=None)
View that allow a user to associate a new openid to its account.
source code
 
dissociate(request, template_name="authopenid/dissociate.html", dissociate_form=OpenidDissociateForm, redirect_field_name=REDIRECT_FIELD_NAME, default_redirect=settings.LOGIN_REDIRECT_URL, extra_context=None)
view used to dissociate an openid from an account
source code
Function Details [hide private]

signin_success(request, identity_url, openid_response, redirect_field_name=REDIRECT_FIELD_NAME, **kwargs)

source code 

openid signin success.

If the openid is already registered, the user is redirected to url set par next or in settings with OPENID_REDIRECT_NEXT variable. If none of these urls are set user is redirectd to /.

if openid isn't registered user is redirected to register page.

signin_failure(request, message, template_name='authopenid/signin.html', redirect_field_name=REDIRECT_FIELD_NAME, openid_form=OpenidSigninForm, auth_form=AuthenticationForm, extra_context=None, **kwargs)

source code 

falure with openid signin. Go back to signin page.

:attr request: request object :attr template_name: string, name of template to use, default is 'authopenid/signin.html' :attr redirect_field_name: string, field name used for redirect. by default 'next' :attr openid_form: form use for openid signin, by default `OpenidSigninForm` :attr auth_form: form object used for legacy authentification. by default AuthentificationForm form auser auth contrib. :attr extra_context: A dictionary of variables to add to the template context. Any callable object in this dictionary will be called to produce the end result which appears in the context.

signin(request, template_name='authopenid/signin.html', redirect_field_name=REDIRECT_FIELD_NAME, openid_form=OpenidSigninForm, auth_form=AuthenticationForm, on_failure=None, extra_context=None)

source code 

Signin page. It manage the legacy authentification (user/password) and authentification with openid.

:attr request: request object :attr template_name: string, name of template to use :attr redirect_field_name: string, field name used for redirect. by default 'next' :attr openid_form: form use for openid signin, by default `OpenidSigninForm` :attr auth_form: form object used for legacy authentification. By default AuthentificationForm form auser auth contrib. :attr extra_context: A dictionary of variables to add to the template context. Any callable object in this dictionary will be called to produce the end result which appears in the context.

Decorators:
  • @not_authenticated

complete_signin(request, redirect_field_name=REDIRECT_FIELD_NAME, openid_form=OpenidSigninForm, auth_form=AuthenticationForm, on_success=signin_success, on_failure=signin_failure, extra_context=None)

source code 

in case of complete signin with openid

:attr request: request object :attr openid_form: form use for openid signin, by default `OpenidSigninForm` :attr auth_form: form object used for legacy authentification. by default AuthentificationForm form auser auth contrib. :attr on_success: callbale, function used when openid auth success :attr on_failure: callable, function used when openid auth failed. :attr extra_context: A dictionary of variables to add to the template context. Any callable object in this dictionary will be called to produce the end result which appears in the context.

register(request, template_name='authopenid/complete.html', redirect_field_name=REDIRECT_FIELD_NAME, register_form=OpenidRegisterForm, auth_form=AuthenticationForm, register_account=register_account, send_email=True, extra_context=None)

source code 

register an openid.

If user is already a member he can associate its openid with its account.

A new account could also be created and automaticaly associated to the openid.

:attr request: request object :attr template_name: string, name of template to use, 'authopenid/complete.html' by default :attr redirect_field_name: string, field name used for redirect. by default 'next' :attr register_form: form use to create a new account. By default `OpenidRegisterForm` :attr auth_form: form object used for legacy authentification. by default `OpenidVerifyForm` form auser auth contrib. :attr register_account: callback used to create a new account from openid. It take the register_form as param. :attr send_email: boolean, by default True. If True, an email will be sent to the user. :attr extra_context: A dictionary of variables to add to the template context. Any callable object in this dictionary will be called to produce the end result which appears in the context.

Decorators:
  • @not_authenticated

signout(request, next_page=None, template_name='registration/logged_out.html')

source code 

signout from the website. Remove openid from session and kill it. :attr request: request object :attr next_page: default redirect page after logout :attr template_name: string, name of template to use when next_page isn't set, 'registration/logged_out.html' by default

Decorators:
  • @login_required

password_change(request, template_name='authopenid/password_change_form.html', set_password_form=SetPasswordForm, change_password_form=PasswordChangeForm, post_change_redirect=None, extra_context=None)

source code 

View that allow a user to add a password to its account or change it.

:attr request: request object :attr template_name: string, name of template to use, 'authopenid/password_change_form.html' by default :attr set_password_form: form use to create a new password. By default ``django.contrib.auth.forms.SetPasswordForm`` :attr change_password_form: form objectto change passworf. by default `django.contrib.auth.forms.SetPasswordForm.PasswordChangeForm` form auser auth contrib. :attr post_change_redirect: url used to redirect user after password change. It take the register_form as param. :attr extra_context: A dictionary of variables to add to the template context. Any callable object in this dictionary will be called to produce the end result which appears in the context.

Decorators:
  • @login_required

associate_failure(request, message, template_failure="authopenid/associate.html", openid_form=AssociateOpenID, redirect_name=None, extra_context=None, **kwargs)

source code 

function used when new openid association fail

Decorators:
  • @login_required

associate_success(request, identity_url, openid_response, redirect_field_name=REDIRECT_FIELD_NAME, send_email=True, **kwargs)

source code 

function used when new openid association success. redirect the user

Decorators:
  • @login_required

complete_associate(request, redirect_field_name=REDIRECT_FIELD_NAME, template_failure='authopenid/associate.html', openid_form=AssociateOpenID, redirect_name=None, on_success=associate_success, on_failure=associate_failure, send_email=True, extra_context=None)

source code 

in case of complete association with openid

Decorators:
  • @login_required

associate(request, template_name='authopenid/associate.html', openid_form=AssociateOpenID, redirect_field_name=REDIRECT_FIELD_NAME, on_failure=associate_failure, extra_context=None)

source code 

View that allow a user to associate a new openid to its account.

:attr request: request object :attr template_name: string, name of template to use, 'authopenid/associate.html' by default :attr openid_form: form use enter openid url. By default ``madrona.openid.forms.AssociateOpenID`` :attr redirect_field_name: string, field name used for redirect. by default 'next' :attr on_success: callbale, function used when openid auth success :attr on_failure: callable, function used when openid auth failed. by default ``madrona.openid.views.associate_failure` :attr extra_context: A dictionary of variables to add to the template context. A callable object in this dictionary will be called to produce the end result which appears in the context.

Decorators:
  • @login_required

dissociate(request, template_name="authopenid/dissociate.html", dissociate_form=OpenidDissociateForm, redirect_field_name=REDIRECT_FIELD_NAME, default_redirect=settings.LOGIN_REDIRECT_URL, extra_context=None)

source code 

view used to dissociate an openid from an account

Decorators:
  • @login_required