Note that there are some explanatory texts on larger screens.

plurals
  1. POPerforming authorized (through facebook) REST requests to my node.js server on a PhoneGap app
    primarykey
    data
    text
    <p>Since this issue is about three technologies I'd like to quickly introduce each of them:</p> <ul> <li>node.js: javascript on the server side (consider it my webserver)</li> <li>PhoneGap: framework that allows me to write Android applications in HTML/Javascript/CSS.</li> <li>facebook authentication: using <a href="https://github.com/bnoguchi/everyauth" rel="noreferrer">everyauth</a> to let my users login with their facebook account</li> </ul> <p><strong>The objective</strong>: I need my PhoneGap application to communicate with my server using a REST based protocol. Many of these requests may only be made when the user has logged in to my server, using their Facebook account. Thus, the user needs to login and then go to the logged in state of the PhoneGap application.</p> <p><strong>The issue</strong>: When I setup everyauth for facebook I basically have an URL, like domain.com/auth/facebook which will redirect to Facebook's login "popup". When the user then accepts the login, the server will know, and so far everything is good. The problem is that</p> <ol> <li>the user now has to be redirected to some external URL, while he should simply get back to the PhoneGap application (in a logged-in state)</li> <li>The PhoneGap app does not retrieve the authentication token, or whether authentication was successful or not, because the login process is done in the external URL domain.com/auth/facebook while the PhoneGap application's HTML is stored on and run from the phone itself</li> </ol> <p><strong>Cause of the issue</strong>: the reason this issue appears while it does not for a normal web application, is that the PhoneGap application's HTML files are stored and run from the phone itself while authentication goes through domain.com/auth/facebook, which is considered to be a different domain.</p> <p><strong>Suggested approach #1</strong>: a PhoneGap user has recommended me to use this <a href="https://github.com/davejohnson/phonegap-plugin-facebook-connect" rel="noreferrer">Android-Facebook plugin for PhoneGap</a>. The issue here is that the server does not act as an authentication middle-man. Thus, the user would have to inform the server of their authentication token instead of the normal approach where the server informs the user of a successful authentication procedure and the corresponding tokens. This seems like a severe vulnerability.</p> <p>How should I tackle this issue?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload