Facebook login, redirect to server then app - javascript

I'm trying to login via FB in my app (written using jQuery Mobile and wrapped with phonegap build). When I click on the link the app opens
myserver.com/login
At this point the server (python) calls FB login function. Once the user has logged in FB will redirect to my server again, where I'll do some stuff.
Now, how can I redirect from my server back to my app? I tried to pass
document.URL
to the server and redirect there but my phone says I don't have permission to acces file://android_asset/www/index.html
Thanks to anyone who is willing/able to help.

Solved using childbrowser plugin.
In phonegap build
https://build.phonegap.com/docs/plugins

Related

Facebook Login on local host . http local host not working

I am building an project for which i require facebook login. I have created an app on facebook for developers and have followed all instructions and tutorial for it. Now when i call api. it is giving an error show in below image.
i have referred to this answer Working with Facebook login from localhost
and this one also
facebook login on localhost without https
using these two answers i have created an test app from original app on facebook but still cant toggle enforce https option
Is there any other way or any update on previous answers?

Redirect to login page after session timeout or restarted application

I have a spring-boot application, with front of single page application using java script and react.
When the app is upload I have a login page.
In uploading i redirect the app to the login page by using spring security.
Now I am trying to redirect my app to the login page if my session timeout or if I restarted my spring-boot-application.
Do you have any insights to a simple way to implement this?
We use spring boot with a React SPA. You can implement an API which checks if the current user is logged in based on a session cookie. If the API returns you are not logged in then change the SPA to the login page. Use setInterval/setTimeout to call this API in the background at regular intervals.

How to implement Facebook Social Login in Hybrid application?

I was planning to use Facebook Social Login in my Hybrid application ( HTML5/CSS/JS and Cordova) However on going to facebook developer I could not see an option for choosing cordova based app.
So shall I consider www , i.e. Javascript based SDK for implementing facebook social login?
From security point of view, is it good choice to choose JS SDK in hybrid application?
Thanks!
Yes, you can choose www for create app for hybrid platform and you just need to set the App id into application so if someone decompile your app they just get an App Id and nothing else, other all things are saved into your developer facebook account.
So you can create your app with this www without worrying about the security of an app.
Also you can create Facebook login with the simplest use of OpenFB,
You just need to create Facebook API from Facebook Developer Account
And Pass the App ID into javascript file of facebook login function.

How to auto login into login page after user exits the app?

I have a login page via WCF restful APIs. I am logging in and now the problem after logging in if user exits in the app and try to re open the app, the app doesn't want to ask the user for credentials by storing the previous credentials. It has to automatically redirect to the another page. Any ideas, suggestions? I'm using JavaScript and HTML & Cordova.
Take a look at this answer
Cordova app with autologin feature
This answer is one of the best ways to implement autologin in hybrid apps, to me.

Detect if user is Page administrator with FB JS SDK

I have created a Facebook app, added it to a Facebook Fan page and I want to detect whether the user visiting the app tab is an administrator of the actual Fan Page (not the app). Is this possible through FB's JS SDK?
If the user has authorised your app and you have the manage_pages permission from them, yes.
Otherwise, no, you'll need to do this server side by parsing the signed_request

Categories

Resources