Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Login service for Mozilla Persona accounts
JavaScript
branch: master
Failed to load latest commit information.
.gitignore
LICENSE
README.md
package.js
persona_client.js
persona_common.js
persona_server.js
smart.json

README.md

meteor-accounts-persona

A meteor package for Mozilla Persona, the decentralized authentication system.

See Demo App (View Source)

Watch Quick Setup Tutorial

View package in the Atmosphere package repository

Package Dependencies

  • accounts-base
  • accounts-oauth

Install

mrt add accounts-persona

mrt is a Meteorite command line tool. Visit Meteorite's page to learn more.

Include Persona Library

Since version 0.1.3 this package requires you to include the Persona library yourself, please read below.

Mozilla strongly recommends directly downloading the persona library from their servers due to possible changes, and Meteor does not allow dynamically loading remote JavaScript files. To meet both requirements you MUST include the Persona library in your head section. To do this, in one template file, add the following code:

<head>
    <script>
        (function() {
            var t   = document.createElement('script');
            t.type  = 'text/javascript';
            t.async = true;
            t.id    = 'persona-lib';
            t.src = '//login.persona.org/include.js';
            var s = document.getElementsByTagName('script')[0];
            s.parentNode.insertBefore(t, s);
        })();
    </script>
</head>

The code will load the persona library directly from Mozilla without blocking the rest of the page loading.

Usage

If you use {{loginButtons}} from accounts-ui, then "Sign in with Persona" will show up right after you install this package. (NOTE: to use {{loginButtons}} make sure you have accounts-ui added)

To create a custom login button, use an event handler:

Template.header.events({
    'click #loginPersona': function () {
            Meteor.loginWithPersona();
    }
});

You can download the official Persona Buttons from Persona Branding Resources

Meteor.loginWithPersona(); supports Meteor.loginWithExternalService([options], [callback])

FAQ

See the Github Wiki for FAQ

Something went wrong with that request. Please try again.