I have a scenario.: My website contains list of Agents. Each agent is having his/her own website. So when any agent enters into my website and searches then he will get list of agent details along with their basic information. Here I want to display people who liked the individual websites using facebook.
Using facepile I had acheived this but facepile works only if the user is logged-in to the facebook. This scenario is also fine with me. But my requirement is I am able to see a white patch of space between the results when user is not connected to FB. I want to make this patch to be visible false when not connected to FB.
I am not using any application or App ID, I just used Iframe and url of agents facebook ID as href.
Instead of the broken facepile plugin, try using the like plugin as it does not exhibit this behaviour.
Related
I'm trying to implement Office 365 Single Sign On using WSFederation and I have built an ASP.NET MCV app according to these instructions.
It works to a degree; the user is directed to sign in to Azure AD and reaches the home page.
Some people who will use this app belong to companies who have their own custom Microsoft login pages- the user is redirected to these when they enter their email and press tab. If their login page is very customised, they then have to enter their email again. My question is this: is there a way to redirect the user to the custom login page automatically, since I already know which organisation they belong to?
I have tried changing the wsFederation homeRealm in the web.config to the organisation domain name, which ought to work but does not. It adds "&?whr=domain.org" (for example) to the end of the URL generated by the app. The reason it doesn't work is that when this URL is followed, Microsoft redirects the user to a slightly different address where they log in and the home realm (whr) parameter is lost.
Is there any way to automatically redirect to the organisation's login page? Or am I simply building the wrong type of app?
Thanks in advance,
LD.
Well, I seem to have answered my own question.
There are probably better ways, but this is what I did:
Using these instructions I created a sign in controller and passed the url of the actual login page (which is different from the url generated by the app) into the Redirect function. I added a whr parameter to this and everything redirects properly.
I am implementing the Facebook Login widget inside my ASP.NET 4.5 C# web application. When I clicked the login button I eventually get the accessToken. My question is regarding making the user persistant in my application.
There is data that is associated with the specific facebook user. when the user log off and log in back (assuming that the cookie might be deleted), I want to be able to recognize him again to display the relevant information.
I know that I need to use the database, but what is the best practice to do so. Should I use the user ID or email address as a unique user identification string?
I am using MySQL as the backend.
I have been working on a similar application which uses either Facebook (OAuth), Google (OpenId) or a manual registration login approach.
My prefered solution was to ask the user for their email address, you will need to request extended permissions on the email field from Facebook as it is not offered up by default.
http://developers.facebook.com/docs/authentication/permissions
My table structure looks like this.
User
Id (int)
Email (nvarchar(256))
FacebookToken (nvarchar(256))
GoogleToken (nvarchar(256))
The advantage to this method is you are able to link up your users to the right account if you decide later to add another authentication / identification service or roll your own. It won;t matter if they login to FB, Google or Twitter - you always know whcih account to attach them to.
It is also useful to have an email address for each of your users regardless.
Regards
Steve
The C# Facebook SDK host on github allows Windows Store apps to login to their account via the app and post e.g. statuses or app related content through the app, however there are still some concepts that I don't understand.
Firstly, is it only possible to perform facebook related tasks after I have logged in for the current session. Can I not login in once (say, when I first download an app) and then have the app retain my settings. Then, whenever I want to post some content via my app and can just do it straight away, instead of having to sign in again (in the same or another session)
I was hoping that in my app I would be able to login in via an option in the settings charm which would navigate to my HomePage.xaml, and then I would be able to save that login state for multiple sessions. Currently I have this first bit running (though not completely, I can login but that's it right now), but how would I/can I automatically post content in future sessions without having to log in again?
Secondly, many apps that integrate with Facebook apps, that allow the user to post data stored in their local app or web user account via the Facebook app counterpart. How is this performed?
Say I have a class MyDataClass which contains properties DataTitle, DataItem1 and DataItem2. I would want to be able to send this to my wall, and have it display as an ordinary post (examples for this sort of functionality include things like ask.fm and formspring.) Would I then even be able to store this data via my Facebook app, and be able to send it to the users friends should they wish?
I would appreciate it if someone could explain whether these things to me. I've been search for a couple of days now and haven't answered these bigger questions.
Facebook C# SDK can be used via NuGet or you can get library from GitHub. When any user logs in via Facebook, the login result returns "Access Token". It is unique among all the Facebook users. You can save that access token in individual user's LocalSetting. Local setting documentation can be found here. Local setting can be used in this way.
//create instance of local settings
var localSettings = Windows.Storage.ApplicationData.Current.LocalSettings;
// Create a setting
localSettings.Values["FB_Access_Token"] = "THIS_IS_DUMMY_ACCESS_TOKEN";
// Read data from a setting
var objFbAccessToken = localSettings.Values["FB_Access_Token"];
if (objFbAccessToken == null)
{
// No data
// Do relogin of Facebook and save new facebook token
}
else
{
// Access user's Facebook data with help of Facebook C# SDK and Access Token
}
// Delete a setting
localSettings.Values.Remove("objFbAccessToken");
See this for extending access token.
Get long live access token from Facebook
I am using ShareLinkTask to post URL to social websites like twitter and facebook. Along with the URL ,i want to add a picture URI and the picture should display in sites.Is it possible ? Also is it possible to share when a different user is using the app ?since only one account is in sync and always the posting to sites happens with the account in sync with the phone.Can we have the login again while sharing so that the person using the app can post to his wall?
No. Tasks are somewhat more limited compared to a direct API layer implementation that you would get through a service-based SDK. They are always bound to the accounts that are associated with the device and you cannot log the user in/out with those from the app, unless the user himself decides to switch the accounts.
Also, at this point you cannot attach media content to a ShareLinkTask unless you already uploaded it through a service (such as IMGUR) and just posting a link to it.
I'm creating a desktop application in C#.
one of the things that this application should do is to publish things to the status of the user in facebook (like: "dave just won 3 gold medals" ). this should happen whether the user is logged in now to facebook or not. I want the user to give me all the needed permissions once and then everything would happen automatically (I would save whatever is needed on my DB).
I tried using facebook developer toolkit 2.0 for .net but didn't see anything there that could help me.
ANY help would be appreciated.
For you question:
you need to use the Facebook Connect API
there is a Feature called offline_access - its an extended permission.
In FB Connect you need to toggle the correct popup :
The workflow will be like that:
User uses FB Connect to confirm the fact he wants to connect your app to his facebook account.
You trigger the popup.
You can then call all calls on his permission even if he is offline (or not using facebook connect)
For the sake of understanding: FB Connect is meant that way that you can easily log the user into his app and do everything on his behalf. offline_access is actually meant for cronjob work.
Iv'e got some answers here. I think it answers other questions I saw in the web lately:
My answer is related to desktop applications that works outside of facebook (facebook connect).
+ I'm using the facebook developer toolkit 2.1:
Here is how to get the special permission, needed to for offline access. and how to get the session key:
facebook.Components.FacebookService FS = new facebook.Components.FacebookService();
FS.GetExtendedPermission(facebook.Types.Enums.Extended_Permissions.offline_access);
The second line will force you to login and afterwards would ask for the permission after the user choose to grant the permission, you are given in the post URL - the fb_si_session_key. BUT the toolkit developers didn't do enough to bring it to you :-(
So you have few options. the simple one is to do:
FS.Logoff();
FS.ConnectToFacebook();
What will happen is that you'll see the login screen for a second and before youll be able to click anything it would vanish. but this time you'll have the right session key. you can get it like that:
string myPermanentSessionKey = FS.API.SessionKey;
If you dont want to show that annoying screen again you have few options, all of them are related to changing the source files of the toolkit. I'm not gonna get into it here, but just tell you a simple option: in the facebookconnect() function I changed it to receive a parameter (isShow) when I send true to it, it behaves normal, when I send false to it - it skips on the formLogin.ShowDialog();
It's working.