Solved

Firebase authentication - email based vs custom

Posted on 2016-10-31
3
296 Views
Last Modified: 2016-11-02
I am developing a mobile IOS appp which will consume some data from Firebase. I need to implement functionality so that only authenticated users, who have paid a monthly subscription will be able to continue using my App. I would like to know if this kind of functionality can be built for an IOS App using Firebase's email based authentication. If email based authentication cannot help me implement this functionality, please let me know if Firebase's custom authentication would help me achieve this. I would also appreciate advice if there are any other reliable alternative backend services available that can help me implement this kind of functionality for my App without me needing to do too much work as I do not have technical expertise to develop this part of the functionality for my App.
Thank you for your help.
0
Comment
Question by:FaheemAhmadGul
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 47

Expert Comment

by:Jackie Man
ID: 41867877
Authenticate with Firebase on iOS Using a Custom Authentication System
https://firebase.google.com/docs/auth/ios/custom-auth

Have a look of the link above. It seems to me that Firebase's custom authentication would help you.
0
 
LVL 64

Accepted Solution

by:
btan earned 500 total points
ID: 41867897
Firebase email authentication can be straightforward if you are alright with user to be just being having login to their email account as a scheme. E.g. For Gmail users
function loginWithGoogle() {
  // Instantiate the Google authentication provider
  var provider = new firebase.auth.GoogleAuthProvider();
  // Handle the authentication request using the Popup method
  firebase.auth().signInWithPopup(provider).then(function(result) {
    var user = result.user;
  }).catch(function(error) {
    console.log(error);
  });
}
If you wish to extend beyond email like additional features that Firebase does not offer such as single sign on, 30+ social providers, multifactor authentication, passwordless authentication, you should go for custom scheme. An example is via Auth0. You need to go into
1. "Setting Up A Custom Provider with Firebase"
2. "Integrating Auth0 into Firebase".
3. Utilize the Auth0 Lock widget as well as the Auth0 js library to handle the user authentication and token exchange between Auth0 and Firebase. A giod step through example in
https://auth0.com/blog/firebase-authentication-with-firebase-3.0-and-auth0-integration/

Check out the GitHub repo to get the code and sign up for a free Auth0 and Firebase account to get started if you are interested. For info, a code snippet
// Instantiate the lock and auth0 libraries
  var lock = new Auth0Lock('YOUR-AUTH0-CLIENT-ID', 'YOUR-AUTH0-DOMAIN.auth0.com');

  var auth0 = new Auth0({ domain : 'YOUR-AUTH0-DOMAIN.auth0.com', clientID: 'YOUR-AUTH0-CLIENT-ID'})
0
 
LVL 1

Author Closing Comment

by:FaheemAhmadGul
ID: 41870300
Many thanks. Greatly appreciated.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There is a lot to be said for protecting yourself and your accounts with 2 factor authentication.  I found to my own chagrin, that there is a big downside as well.
Today’s effective marketing is about coming down to the customers’ level and engaging in a whole new way. A text message is one of the most effective and influential ways that you can engage your customers. Here are eight ways that you can utilize t…
This video is in connection to the article "The case of a missing mobile phone (https://www.experts-exchange.com/articles/28474/The-Case-of-a-Missing-Mobile-Phone.html)". It will help one to understand clearly the steps to track a lost android phone.
This video demonstrates how to sync Microsoft Exchange Public Folders with smartphones using CodeTwo Exchange Sync and Exchange ActiveSync. To learn more about CodeTwo Exchange Sync and download the free trial, go to: http://www.codetwo.com/excha…

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question