OAuth Service with Firebase and ng-cordova-oauth to do Social Login in Ionic
- LinkedIn;
- Facebook;
- Google+;
- Twitter.
- Apache Cordova 3.5+
- Apache Cordova InAppBrowser Plugin
- Apache Cordova Whitelist Plugin
- jsSHA 1.6.0 Secure Hash Library (Twitter, Withings, and Magento only)
- Ionic Framework 1.0+
Add this repository as dependency:
$ bower install ionic-oauth-service -S
This action will set the dependency and add it to the bower.json
file.
The JavaScript library must then be added to your index.html file:
<script src="../ionic-oauth-service/dist/config.js"></script>
<script src="../ionic-oauth-service/dist/ionicoauthservice.min.js"></script>
Copy the following file from this repository to your Ionic project:
$ cd ionicoauthservice
$ cp config.js /path/to/project/www/js/config.js
$ cp ionicoauthservice.min.js /path/to/project/www/js/ionicoauthservice.min.js
The JavaScript library must then be added to your index.html file:
<script src="js/config.js"></script>
<script src="js/ionicoauthservice.min.js"></script>
Once added to your index.html file, you must inject the library into your app.js module. Make your app.js file look something like the following:
angular.module('starter', ['ionic', 'ionicOAuthService'])
Now you need to update the config.js file to use your socials signIn. You must need put the Firebase URL and should set just the socials that you want to do SignIn.
At this point, ionicOAuthService is installed into your project and is ready for use.
This library will NOT work with a web browser, ionic serve, or ionic view. It must be used via installing to a device or simulator.
Tweet me on Twitter - @silvamarcel
Ionic Framework - http://www.ionicframework.com
AngularJS - http://www.angularjs.org
Apache Cordova - http://cordova.apache.org
Ionic Brazil - http://ionicbrazil.com