JavaScript API

The JavaScript file that comes with django-browserid, browserid.js, includes a a few public functions that are exposed through the django_browserid global object.

django_browserid.login([next, requestArgs])

Manually trigger BrowserID login.

  • next (string) – URL to redirect the user to after login.
  • requestArgs (object) – Options to pass to

Manually trigger BrowserID logout.

  • next (string) – URL to redirect the user to after logout.

Check if the current user has authenticated via django_browserid. Note that this relies on the #browserid-info element having been loaded into the DOM already. If it hasn’t, this will return false.

Returns:True if the user has authenticated, false otherwise.

Retrieve an assertion from BrowserID and execute the given callback with the assertion as the single argument.

  • callback (function) – Callback to execute after the assertion has been retrieved.
django_browserid.verifyAssertion(assertion[, redirectTo])

Verify an assertion, and redirect to a URL on success. Calling this method submits a form to the server and changes the current page as if the user was attempting to login.

  • assertion (string) – Assertion to verify.
  • redirectTo (string) – URL to redirect to on success.

Project Versions

Previous topic


Next topic

Developer Setup

This Page