colinskow / ng-superlogin

AngularJS bindings for the SuperLogin project
MIT License
15 stars 17 forks source link

Ionic integration #1

Closed AdrienDC closed 8 years ago

AdrienDC commented 8 years ago

Hi @colinskow , I've very interested by your library to integrate it in my ionic app however I'm a bit lost on how to do it.. I'd like to use Linkedin authentication and Firebase but with this library I can't really reproduce what you've done in https://github.com/colinskow/superlogin-demo A bit more help would be great , thanks

colinskow commented 8 years ago

SuperLogin works with any backend database that is compatible with CouchDB, so it will not work with Firebase. If you need to use Firebase with LinkedIn, you can look at a solution like Auth0.

On the other hand, if you want to use LinkedIn authentication with Ionic on a CouchDB backend, SuperLogin can definitely help you.

First you need to configure SuperLogin on your Express backend:

var LinkedinTokenStrategy = require('passport-linkedin-token-oauth2').Strategy;
superlogin.registerTokenProvider('linkedin', LinkedinTokenStrategy);

Next you need to setup the SocialGap plugin for Cordova to get your LinkedIn access token.

Finally call superlogin.tokenSocialAuth('linkedin', ACCESS_TOKEN) from your NG-SuperLogin front-end.

If you need help, look for @ronyron on the PouchDB Slack channel, who is doing a project similar to yours and has it working.

ronycohen commented 8 years ago

+1 for the solution, I make it work with Ionic