Output the HTML for the login form and the info tag. Should be called once at the top of the page just below the <body> tag.
Output the HTML for a BrowserID login link.
Parameters: |
|
---|
Output the HTML for a BrowserID logout link.
Parameters: |
|
---|
Returns <script> tags for the JavaScript required by the BrowserID login button. Requires use of the staticfiles app.
Parameters: | include_shim – A boolean that determines if the persona.org JavaScript shim is included in the output. Useful if you want to minify the button JavaScript using a library like django-compressor that can’t handle external JavaScript. |
---|
Verify assertion using an external verification service.
Parameters: |
|
---|---|
Returns: | A dictionary similar to the following: {
u'audience': u'https://mysite.com:443',
u'email': u'myemail@example.com',
u'issuer': u'browserid.org',
u'status': u'okay',
u'expires': 1311377222765
}
|
Raises : | BrowserIDException: Error connecting to remote verification service. |
Uses Django settings to format the audience.
To figure out the audience to use, it does this:
If settings.DEBUG is True and settings.SITE_URL is not set or empty, then the domain on the request will be used.
This is not secure!
Otherwise, settings.SITE_URL is compared with the request domain and will raise an ImproperlyConfigured error if they don’t match.
Examples of settings.SITE_URL:
SITE_URL = 'http://127.0.0.1:8001'
SITE_URL = 'https://example.com'
SITE_URL = 'http://example.com'
Bases: django.views.generic.edit.BaseFormView
Login view for django-browserid. Takes in an assertion and sends it to the remote verification service to be verified, and logs in the user upon success.
URL to redirect users to when login fails. This uses the value of settings.LOGIN_REDIRECT_URL_FAILURE, and defaults to '/' if the setting doesn’t exist.
URL to redirect users to when login succeeds if next isn’t specified in the request. This uses the value of settings.LOGIN_REDIRECT_URL, and defaults to '/' if the setting doesn’t exist.
Log the user into the site and redirect them to the post-login URL.
If next is found in the request parameters, it’s value will be used as the URL to redirect to. If next points to a different host than the current request, it is ignored.
Redirect the user to a login-failed page, and add the bid_login_failed parameter to the URL to signify that login failed to the JavaScript.
Parameters: | error – If login failed due to an error raised during verification, this will be the BrowserIDException instance that was raised. |
---|
Send the given assertion to the remote verification service and, depending on the result, trigger login success or failure.
Parameters: | form – Instance of BrowserIDForm that was submitted by the user. |
---|
Trigger login failure since the form is invalid.
Trigger login failure since we don’t support GET on this view.
Retrieve failure_url from the class. Raises ImproperlyConfigured if the attribute is not found.
Run some sanity checks on the request prior to dispatching it.