• Aayush anand

    Hi nice tutorial , i am getting error in running the backend, it says node_module is not recognised as an internal or external command , my node version is v6.10.3 and npm version is 5.0.1, please help.

    • Hi Aayush, what platform are you on? Is it OS X, Linux or Windows?

      • Aayush anand

        Windows 7

        • Unfortunately, I don’t have Windows handy, so I can’t try it out myself. But it looks like the issue might be with the paths in ‘start’ command in package.json:

          “start”: “node_modules/nodemon/bin/nodemon.js — node_modules/babel-cli/bin/babel-node.js server.js”
          },

          Maybe try changing “node_modules/…” to absolute path, something like “C:Projectsbackendnode_modules…”.

          Or if you google that error there is a lot of similar reports for Windows. Let me know when you find out what the problem was, so I can update the tutorial!

        • Also try this:

          “start”: “nodemon node_modules/nodemon/bin/nodemon.js — node_modules/babel-cli/bin/babel-node.js server.js”

          And let me know if that works.

  • Peter

    I’ve been following along with your tutorials and they’ve worked great for me so far. I’m working in the expo development environment so I haven’t worked in xcode at all. Is there any way to complete the platform specific portions of the FB auth if I can’t access the .xcodproj files?

  • Frederico Quintão

    Hi, thanks for the great tutorial! I have a question here. I’m using the create-react-native-app command to setup the app:

    create-react-native-app OAuthLogin

    instead of
    react-native OAuthLogin

    this does not generate any Android nor IOS folder. Does it mean I cannot use the “Linking” tricky?

    Again, thanks for the great work!

  • Robert Stevens

    Hi, great tutorial. Do you have one where you use Firebase to handle the social auth?

  • Jooyoung Lee

    Hello! Thank you for a wonderful post. I have succeeded facebook login, but i wonder how to send token/cookies to the app when the authentication is done, and the way to store this token/cookie in the native app so that users don’t need to login even after they leave the app. Can you teach me?

  • Almog Kashany

    Hi ,
    how i can run your project from github ?
    i run npm start in the server and in the app .
    in the appp i get ” Loading dependency graph, done.” .
    and nothing happen .
    how i can get QR for Expo to see the demo ?
    in localhost:8081/ i get only “React Native packager is running.”.

    thank you .

  • Abhijit

    npm start gives the error and didnt start the server
    so when webpage open it gives error like
    my app run on 8081 port
    The webpage athttp://localhost:3000/auth/facebook could not be loaded because ERR_CONNECTION_REFUSED

  • John

    Is it possible to restrict opening the authentication endpoint to just the mobile app? And prevent all other computers from accessing `/auth/provider/` ?

    P.S : You’ve mentioned `/auth/facebook` as redirect URI in facebook developer portal but in the screenshot it’s `/auth/facebook/callback` . Same case in Google. May I know which is right?

    • You can add a secret key to all requests to `/auth/provider/` and deny access if the key wasn’t provided or incorrect.

      P.S.: `/auth/facebook/callback` is the right one. Sorry about that, I fixed the typo.

  • Leopotam Beast

    >> That’s because it’s considered bad UX and Apple won’t approve your app if you were to publish it to Apple Store.

    Are you sure about it? Because apple rejects Linking.canOpenURL due to it can be used for installed apps scanning.

    • I was submitting an app recently and it got rejected because of that.

  • Sandino

    Hi @konstantinshkut:disqus I want to say a big THANK YOU!! for sharing this. It was really well explained and easy to follow. Following you hoping to see more good content 🙂

  • Patrick Kelly

    Great tutorial! I followed this tutorial and the main UI works, but I get a message in Safari “Safari cannot open the page because it could not connect to the server” when I click on either of the buttons. This happens on my iPhone 7 and on my emulator. Any ideas how to prevent this? Thanks!

    • Irina Tyshkevich

      I’m having the same issue. Any luck??

  • Great tutorial, thank you 🙂

    2 things thoughts:

    1. In the npm start script you should add “node” at the start:
    “start”: “node node_modules/nodemon/bin/nodemon.js — node_modules/babel-cli/bin/babel-node.js server.js”
    instead of:
    “start”: “node_modules/nodemon/bin/nodemon.js — node_modules/babel-cli/bin/babel-node.js server.js”

    2. What about logging out? How would you implement that?

  • sicnarfngo

    is there a way to do this without having to use async/wait? im not familiar with that es7 feature.

  • Harry S. Hur

    quick question. what if you want to save user information on your own database?
    what would be the best way to handle this?

    • chris reyes

      have you found a solution to this because I would also like to use this approach to create an account on my app

  • Paulus

    Thank you, very helpful post! Much easier to set up than RN libraries like https://github.com/joonhocho/react-native-google-sign-in

  • Irina Tyshkevich

    Hello! very helpful tutorial. I’m following only the Facebook Connect piece. I’m getting “Safari cannot open the page because the address is invalid. But when I try to open “http://localhost:3000/auth/facebook” in Safari on my computer, it all works fine. Any tips?

  • Irina Tyshkevich

    Is there any chance to extend this such that you can access the user’s Facebook friends etc.? Or do you have any useful links how you would do that if you’re setup your login with this framework. Thanks!

  • Muneeb Shafiq

    npm start gives the error and didnt start the server
    so when webpage open it gives error like
    my app run on 8081 port
    The webpage athttp://localhost:3000/auth/facebook could not be loaded because ERR_CONNECTION_REFUSED
    i guess it is showing error because of permissions. Kindly give solution for this.

  • Flosut Mözil

    Hi!,
    we are setting up oAuth like you in our app. The only thing we encountered was the fact that safari-view and the android-in-app-brower always remember the credentials/cookie? of the user and therefore instantaneously log us into our app. Users are not able to log in with another account. Is there a solution for this problem?