Solved

Firebase authentication - email based vs custom

Posted on 2016-10-31
3
239 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 45

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 63

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Playing HDR x265 HEVC 10bit movie on iPhone 7Plus ? 2 120
Which Oppo n Samsung models are 64bit 6 55
android spyware 5 23
data internet through mobile 14 94
A professional opinion on which Apple product to buy, and a tidbit about the WWDC.
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.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

759 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