Vlad Filippov

Vlad Filippov

software engineer / web dev / open source hacker

Using Mozilla Persona with Meteor

In version 0.5.0, the Meteor web application framework has added official authentication support to Meteor applications. The built-in modules provide an easy way to hook up regular auth and third-party OAuth via Smart packages. The accounts-password,accounts-facebook, accounts-github, accounts-google, accounts-twitter, oraccounts-weibo packages are easy to configure and integrate into Meteor apps.

However, I’ve decided to simplify the auth process even more…

Introducing meteor-accounts-persona, a way for Meteor apps to use Persona – a decentralized and secure authentication system, created by Mozilla. Unlike other third-party OAuth methods, this package requires zero configuration. It also works a little different from other services. For example, unlike the Twitter API, it gives you access to user’s email through Mozilla Persona services.

Right now this smart package is available through meteorite – a popular Meteor package manager, but the goal is to get this project to a state where it can be merged into Meteor’s built-in packages. The source for meteor-accounts-persona is available on GitHub. You can also find this smart package on Atmosphere.

Instructions

Install

mrt install accounts-persona

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

Usage

If you use {{loginButtons}} from accounts-ui, then “Sign in with Persona” will show up right after you install this package.

To create a custom login button, hook up an event handler


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

FAQ

If you have more questions, see the Github Wiki for project FAQ