How to Offer Mozilla Persona as a Sign In Option in Drupal

Mozilla Persona is a single sign on system that allows you to login into websites with a registered email address. To register an email address head over to login.persona.org and sign up. Once signed up you can login to any website that offers Persona.

The module for Drupal allows you to offer Persona as a login option. You can configure the module to be the only sign in method or have it as a second option.

In this video we’ll setup Persona to allow anonymous users to log in.

Module

Drush command:

drush dl persona

Code

$conf['persona_audience'] = 'http://example.com:80';

Resources

Transcript

Mozilla Persona is a single sign on system that allows you to login into websites with a registered email address. To register an email address head over to login.persona.org and sign up. Once signed up you can login to any website that offers Persona.

The module for Drupal allows you to offer Persona as a login option. You can configure the module to be the only sign in method or have it as a second option.

In this video we’ll setup Persona to allow anonymous users to log in.

Getting Started

Before we can begin, download Mozilla Persona from drupal.org. There are no 3rd party libraries required, just download and install the module.

Setup Persona

Go to your main sites directory, for this site its default, and open settings.php. We need to add a single variable called “persona_audience”. Make sure you change “example.com” to your actual domain name. If you do not add the variable, then you will get a status report error.

Now, go to Configuration, “Account settings” and in the “Who can register accounts?” radio button list select Visitors. This will allow users to login without being approved. If you want an administrator to approve each account, then leave “Visitors, but administrator approval is required” selected.

Login Using Persona

Now that the basic setup of the module is done, you should be able to log in using Persona. If you haven’t already, you’ll have to register an email address at login.persona.org. Open up another browser and click on the sign in button. The button is displayed via the “Persona Sign In button” block. If you want to move the block to another region, then go to the Blocks page and assign it to another region.

Also, you can sign in via the general login page.

Quick side note, you can register an email address directly from this dialog box. Just enter in any email address and click on next. Enter in a password, confirm your email address and you’re registered.

Let’s now login with a registered email address. Enter in an address and click on Next. And enter in the password and click on sign in. There you go, now we’re logged in and registered.

Configure Persona

Before we finish up, let’s check out the configuration page for Persona. You can access the page by going to Configuration, “Persona settings”. From this page you can configure a few things like using Persona as the only sign in method, and use the user’s email address as their username.

You can also change the look and feel of the “sign in” button. Finally, you can add links to your “Privacy Policy” and “Terms Of Service” which will appear in the sign in dialog box.

About The Author

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top