I am using v 5 RC and the CSMvc3FacebookApp.sln sample.
When I launch the site locally (using IIS Express as WebServer) by browsing to:
http://apps.facebook.com/myTestApp
HomeController/Index View shows up properly. This means that the facebook settings are correct.
However when I hit the 'About' link (this is where the facebook calls are made) I see an endless loop occur between:
http://apps.facebook.com/santiagoit/Home/About
http://localhost:16874/facebookredirect.axd?code=
If the user is not logged in to facebook. Hitting the 'About' link brings up the facebook login page, endless redirect loop happens after user signs in to facebook.
I tested other sample projects and they behave the same.
I tested with another facebook test app and same results.
I had done a project with the older facebook developer toolkit, but I am new to this SDK.
Any ideas what is going on?
Thank you!
please take a look at the latest docs on the authentication in facebook. They have discontinued the previous protocol for authentication. Now they use straight OAuth2.
Related
I followed this tutorial (https://spring.io/guides/tutorials/spring-boot-oauth2/) to create a facebook oauth2 login and it's working fine.
Once I click on the login button it redirects to the facebook page and after the user logs in it goes back to the application.
Now I want to modify the code so I can have a popup instead of redirecting the application to the facebook web page. I'm trying to find some material on how to do that, but couldn't find anything so far.
Does someone know what needs to be done or have some link / article on how to do that?
Thank you!
That has to be done in the javascript front end. From https://developers.facebook.com/docs/reference/javascript/FB.login/v2.12
Calling FB.login() results in the JS SDK attempting to open a popup window.
I have a Xamarin.Forms iOS/Android app and have to authenticate the user against a Microsoft Azure B2C AD.
I have added the Microsoft.Identity.Client NuGet and using this for authentication.
Login works fine and I am able to use the returned token to call an Azure hosted service of our own.
The trouble is that when I try to logout the user it does not work as expected.
If the user logs out and immediately after kills the app, the next time the app is started the login screen is presented as expected.
To kill the app on iOS I go to app-switcher with double click home button and the swipe up.
But if the user does NOT kill the app, but instead presses my login button (triggers a call to AcquireTokenAsync()) the sign in screen is NOT presented by Microsoft.Identity.Client but instead a valid token is immediately returned and the app is able to use this token for service calls, i.e. it is a valid token.
Next time the app is launched the token is no longer there and the login screen appear.
The strange this is that when I run the sample from GitHub/active-directory-b2c-xamarin-native I see the same behaviour. So I suspect it is a bug in the MSAL component from Microsoft.
According to the sample logout should simply be done with calling
PublicClientApplication.UserTokenCache.Clear(PublicClientApplication.ClientId);
I have also tried with adding
foreach (var user in PublicClientApplication.Users)
{
user.SignOut();
}
without any change.
Any suggestions?
Just add following line in Droid Project:
CookieManager.Instance.RemoveAllCookie();
in iOS,
foreach (var cookie in NSHttpCookieStorage.SharedStorage.Cookies)
{
NSHttpCookieStorage.SharedStorage.DeleteCookie (cookie);
}
and for more details visit this link https://developer.xamarin.com/guides/xamarin-forms/cloud-services/authentication/azure/
This is happening because the service does not support certain features that would result in a user sign out. This is still a work in progress.
I've got a windows phone 8/8.1 app which contains a page with an embedded web browser on it. I build a list of articles extracting information from the website and all of this works fine but note that I only use this web browser to display an article when a user has clicked on the item in my list.
The article in question provides a button to allow user to leave comments via twitter. At the bottom of each article there is a "Twitter Log in" button. When I click on it, it brings me to the authorizing page and it displays the news website as the app I want to authorize.
After entering my twitter credential and clicking on the "Authorize App", I get the following error:
Exception of type 'Microsoft.Phone.Controls.WebBrowserNavigationException' was thrown.
Then a Twitter webpage gets displayed display the following:
There is no request token for this page. That's a special key we need from applications asking you to use your Twitter account. Please go back to the site or application that sent you here and try again. It's probably just a mistake.
It definitely authenticated me as I can see my Twitter account picture but it failed to authorize the app.
I understand that my app is not the original website as it is a wp8/8.1 app but what I'm calling in the web browser is the page that contains all the original code from the news website and therefore you would assume everything would work as if I was calling the website directly from a browser.
If I call the website from the browser that comes with wp8/8.1, it works as expected!! Strangely enough they have the same functionality but using facebook and this works as expected.
I've had a look at html the "twitter authorized page" when called from my phone and when called directly from my web browser on my laptop and while I can clearly see the form contains an hidden field for authenticity_token with a value and a oauth_token with another value, they do differ.
I don't know if they're suppose to be identical but as I said, I don't understand why this wouldn't work as when I display the article in the embedded web browser, you'd assume that everything else that goes on after this would behave as it would in a regular web browser and when this 'authorize app' button is clicked, you'd assume that all values would be passed as normal and the app would get authorized but nope!!
Any suggestions on how I could possible resolve this problem?
Thanks.
I can't really tell what's going on, but it looks like you would have to implement Twitter OAuth. Luckily for you there is already a library that can do that - https://github.com/konradbartecki/TwitterAutherino
I am the author of this library, so let me know if you need some support or non-existent features.
In my WP7.5 app, I have redirect the user to google web page where is asked to giving the app permissions to access to his account, user click yes, but it redirects to a page where there is the code and user is supossed to copy/paste that to my app.
The Response is
Please copy this code, switch to your application and paste it there:
4/3oHAHtqSk1CqA3S8HlEsuQRaE08e.4nCBpXhR-R8WgrKXntQAax02U4CwcgI - Auth code
I want to, when user press ok, return to my app with that code, is there any way to do that?
-SheikAbdullah
If you're using the Browser control, here's a great CodeProject article on how to do it:
Google OAuth2 on Windows Phone
Has anyone had some success implementing OpenID on Windows Phone 7 using PhoneGap?
Another post suggests to use ChildBrowser (Using OpenID on a PhoneGap platform). But when I look at the ChildBrowser plugin for Windows Phone 7 (GitHub link) it seems to be in really bad shape.
Edit: There seem to be no issues with ChildBrowser, I just downloaded the files in the wrong way. But I'm still interested in learning to implement OpenID in this setup.
I am able to solve it in the following way:
1) When User clicks Google, Facebook, Twitter etc, I open a link (http://www.mywebsite.com/login/google) in InAppBrowser (PhoneGap native function, no plugin required).
2) When the link is opened, my server redirects to Google.com and user sees Google login page.
3) User authenticates itself with Google and Google redirects with the token to my server.
4) Now my server uses that token to create some accounts, logs, do some more operations and then redirects to a url with information required by my phone application.
E.g. - It redircts to http://mywebsite.com/login/google/successful?token=<>&query-string-parameters
5) InAppBrowser is listening for URL changes and when it finds a URL with the above pattern, it takes over, strips the URL, parses the information sent with the URL and then closes InAppBrowser.