The Demo. Open a provider.

/*
 * Source code for this demo:
 */

window.ENV = window.ENV || {};
var configuration = window.ENV.torii = {providers: {}},
    redirectUri = 'http://vestorly.github.io/torii/demo.html';

configuration.providers['linked-in-oauth2'] = {
  apiKey: '77h2z5gntwugau',
  redirectUri: redirectUri
};

configuration.providers['google-oauth2'] = {
  redirectUri: redirectUri,
  apiKey:      '541873702882-v95a7bu9lun8u1io07381f7fvh0b9plt.apps.googleusercontent.com'
};

configuration.providers['facebook-connect'] = {
  appId:      '639484756139940'
};

configuration.providers['facebook-oauth2'] = {
  apiKey:      '639484756139940',
  redirectUri: redirectUri
};

require("torii/load-initializers")['default']();

var App = Ember.Application.create({
  rootElement: '#ember-app'
});

App.ApplicationRoute = Ember.Route.extend({
  actions: {
    authenticate: function(provider){
      var controller = this.controller;
      controller.set('error', null);
      controller.set('authData', null);
      this.get('torii').open(provider).then(function(authData){
        controller.set('authData', authData);
      }, function(error){
        controller.set('error', error);
      });
    }
  }
});

Ember.Handlebars.registerBoundHelper('inspect-object', function(obj){
  return new Handlebars.SafeString(JSON.stringify(obj));
});