GithubHelp home page GithubHelp logo

j-mcnally / torii-cordova Goto Github PK

View Code? Open in Web Editor NEW

This project forked from arkadiyk/torii-cordova

0.0 2.0 0.0 12 KB

Addon to use torii authentication in Cordova using SafariViewController iOS component

License: MIT License

JavaScript 77.29% HTML 22.71%

torii-cordova's Introduction

torii-cordova

Addon to use torii authentication in Cordova using SafariViewController iOS component

The addon is based on a method described in the article here: Stop using InAppBrowser for your Cordova/Phonegap oAuth flow

It depends on Custom URL scheme and SafariViewController cordova plugins

Installation

ember install torii-cordova

Setup

  1. Register a custom url scheme with your app, e.g. mycoolapp://
  2. Confugure your Ember project to use cordova-popup
    // config/environment.js
    module.exports = function(environment) {
      var ENV = {
        torii: {
          sessionServiceName: 'session',
          providers: {
            '<provider-name>': {
              remoteServiceName: 'cordova-popup',
              redirectUri: 'http://localhost:4000/fw' // static html with JS
                                                      // for custom url scheme
                                                      // redirect
            }
          }
        }
      };
    }  
  1. You need a static web page hosted on your server in order to do redirect to your cordova app using custom url scheme.
<!DOCTYPE html>
<html>
  <head>
      <meta charset="UTF-8">
      <meta http-equiv="Content-Security-Policy" content="default-src 'none';script-src 'unsafe-inline';">
  </head>
  <body>
      <script>window.location.assign('mycoolapp://token' + window.location.hash);</script>
  </body>
</html>

Please read Stop using InAppBrowser for your Cordova/Phonegap oAuth flow article for details.

torii-cordova's People

Contributors

ember-tomster avatar arkadiyk avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.