OussamaOBO / socialauth

Automatically exported from code.google.com/p/socialauth
0 stars 0 forks source link

Issues with socialauth via ajax #360

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I am developing a server side web app using spring socialauth library by 3 
pillars lab.

When accessing this web app using href in  an anchor tag, I am able to invoke 
the 3rd party application (in my case, facebook) page.

But when i tried calling it using jquery ajax I got "Allow origin header 
error". On searching for this error, I found out that this error is due to the 
ajax calling page and the URL, it is trying to call, being on different 
domains. I have changed the headers in my webapp as: "allow origin to *". After 
this, my webapp does not throw this "allow origin header" error but now 3rd 
party app is throwing this error.

I have tried two types of Cross domain ajax method :

1. JSONP: with this i am able to hit even 3rd party url via ajax but it is 
throwing an error
"Resource interpreted as Script but transferred with MIME type text/html"
As per my understanding, it is throwing error because this method expects JSONP 
as response instead getting text/html in response.

2. CORS (Cross-Origin Resource Sharing):
In this also, facebook is throwing allow origin header.

I want to make ajax call to facebook using my webapp that uses socialauth 
library and it should display facebook page. Plus i dont want to redirect it.

I am stuck at this. Please help.

Original issue reported on code.google.com by vibetes...@gmail.com on 19 Aug 2014 at 12:45

GoogleCodeExporter commented 9 years ago
You cannot do this through AJAX.
To access FB, user need to login and accespt permission.
You cannot show the login page of FB through AJAX to the user of your 
application.

Regards
Tarun

Original comment by tarunnag...@gmail.com on 31 Oct 2014 at 1:31