How to detect if a user comes from facebook or directly - facebook-apps

let's say I have a website, which I'm also using as a facebook app (iframed page tab of a facebook page).
I need to know if the user has opened my site via the facebook app, or not, as I want to change some css and content only if opened in facebook.
Afaik I only get signed_request the first time the user opens the iframe on fb, so I "lose" it after the user navigates on my site.
Is there a better way to do this other than storing the signed_request in session?
Thanks in advance

Related

How can we login multiple account on same browser

I am creating an app with Node.js express to display social media feeds using their API. I am using FACEBOOK, TWITTER, INSTAGRAM. When I click on any social media icon, a popup window is appearing to login. After logging in all of them. I clicked a button to display feeds. This is working good for single account. Now I want to login multiple account for every social media. But whenever I clicked another social media icon to login .I saw there is already logged in.
For example I click Facebook icon to login . After appearing model window I fill up my username(jrajput315) and password. After logging in this account, I want to login some other Facebook account. And I click Facebook icon to login again. But I see (jrajput315) is already logged in there.
Since you are already logged in to Facebook from one account, Facebook uses a sign-in cookie to keep you logged in. Until this cookie is flushed out, you cannot login through another facebook account on the same browser in the same session.
I guess similar practice happens with few other web-apps, if I am not mistaken.

How to pass Login With Google Process in Cocoa WebView

I am developing a cocoa app for Mac OSX. It's a basic browser application and I use webview component.
In the page I want to connect, there is standard Login with Google Account button in order to login with my existing Google Account. When I clicked on this button nothing happens.
The same functionality works properly when I visited the same page by using Safari or any other browser but there is no reaction on webview component.
I've checked the action behind the Google's login button and here is the JS code.
onclick="return Dialog.Login.loginWithGoogle(false, 'https://www.mywebsite.com/-/oauth2callback', 'https://www.mywebsite.com/')"
As a part of the standard oauth process the process also has many redirections after this URL is called and normally should be completed at my site's login screen as expected. However, webview doesn't handle this.
Please note that the web site I am trying to connect in my webview is not belong to me and I have no control on it.
I checked many solutions on the web for 2 days but nothing helped.
Any help/hint will be appreciated.

How could I make sure that facebook reject my request for authentication plugin

About 2 weeks ago, the fb login button on my site was not working. At that time, my site was attacking by some robots.
Is that the reason why my login button was not working anymore?
How could I make sure?
Is there any way like email or some form page to contact with the fb manager?
Thanks a lot.
Pokey
if the bots attacking your website didn't affect the content of your page (the Page you store the javascript calling for the Login for Facebook). it wouldn't make sense not to work. Because the login button access the facebook server, if the javascript part on your page of the Facebook Login is correct, even with attacks it would work perfectly. So maybe it's something else. You need to give more details!

How do I get an APP ID for Facebook on my web site?

First of all, my simple purpose is to add a Facebook login button to my web site. So I go to the login button description.
I must be thick headed, but I cannot get an APP ID. Under the "Authentication" writeup it says, "The JavaScript SDK requires that you register your website with Facebook to get an App ID (or appId)." Clicking on "Register Your Website" takes me to the APPS page. And since the login button is indicated under "Websites", I click that and it just takes me to another page that says I must register my website. I am ready to pull out what hair I have left.
What am I missing? Do I have to create a "new" app? I can't call it login since apparently that already exists.
You need to create an app here:
http://developers.facebook.com/
Click on Apps -> Create New App
Give the app a name etc the you will need to add your websites URL into the Website section.

Redirect to own site when user logs in via Facebook app

I am building an app with the functionality to publish
messages to users walls while specific actions runs on
my website.
What I have done is (briefly):
Registered my own app on Facebook
Added a login button on my website with permission
to publish:
Log in on Facebook
Downloaded facebook-php-sdk library
It is now I start having problems. I do not know how
to do what I want to do now.
What I want to do:
When a user logs on to facebook via my website. I want
a file on my site to be called, where I can update the
user's data in my own database as well.
Because that is not what the canvas url is meant to do? How it
is no, seems no file at all is called on my site when
I click on Login.
Since you are using the Facebook PHP-SDK you noticed that there are two options for the users to login:
Using the XFBML button, which will:
Open a login dialog (pop-up) asking for permissions..etc
When a successful authentication/authorization is complete the dialog will close, the auth.login event will be triggered and based on that the page will get reloaded window.location.reload();
The PHP in the top of the page will get into business and $session = $facebook->getSession(); will actually retrieve a session! $user = $facebook->getUser(); will retrieve the current user
Using the Login URL generated by the Library $loginUrl = $facebook->getLoginUrl(); this URL will get you through the same flow and if you noticed there's a next redirect_uri parameter which will redirect you back after a successful process to that URL (mainly the same URL you are at), where you can change that parameter if you like.
The canvas URL is the URL Facebook uses when it displays your application from within Facebook. You would use this functionality if you expect users to use your application while in Facebook itself.
When authenticating using Facebook's API (assuming graph API usage here), you provide a redirect_uri as part of the authentication URL. Once Facebook has authorized your application, it will redirect the user's web browser to the URI you specified. This URI can be any link you desire on your site. You should use the link as the determination of when the user is logged in successfully, e.g., https://mywebsite/facebook/loggedin.