HOW DOES IT WORK?
Torii is a set of clean abstractions for authentication in Ember.js applications. Users gain authorization to a resource with a Torii provider. Providers are wrappers for the user experience of authenticating to a service and getting an access token or similar authorization. For example, the Torii facebook-oauth2 provider will open a popup for a user to sign into Facebook, which then resolves a promise with the OAuth 2 access token to communicate with Facebook.
Most apps already authenticate users. Torii adapters abstract opening a user session into three actions: opening, fetching, and closing. Just implement an app's authentication API with promises, and Torii's session manager is good to go.
Torii comes with a lightweight session management service built with a state machine and leveraging adapters. New apps can benefit from a cleaner session abstraction at the start, and porting existing codebases to Torii's session service should be easy. Using Torii's session manager is not required though.
If using ember-cli version 0.0.37 or later, you can install torii as an ember-addon. To do so, simply install the `torii` npm module: `npm install torii --save-dev`. The ember-addon infrastructure will take care of adding it to your ember app and initializing it.
Torii is used in production, today, by Vestorly and other companies using Ember.js.