{"id":5710,"date":"2014-04-05T07:07:04","date_gmt":"2014-04-05T07:07:04","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/04\/05\/problem-about-facebook-authentication-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:45:34","modified_gmt":"2022-08-30T15:45:34","slug":"problem-about-facebook-authentication-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/04\/05\/problem-about-facebook-authentication-collection-of-common-programming-errors\/","title":{"rendered":"problem about facebook-authentication-Collection of common programming errors"},"content":{"rendered":"<ul>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/bb2833f64b9cd74538a15a6f6bf4fbf7?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nns-keip<br \/>\ndatabase facebook authentication facebook-authentication<br \/>\nUsers of my application can authenticate via Facebook, so I store facebook uids in my database and when user logs in I need to query my database like this:SELECT * FROM users WHERE uid = _SOME_UID_;Now uid column is VARCHAR, but I think that I need to convert it to some numeric type BIGINT.Why I think I need to do this:processor time: in general operations with a numeric (filtering\/indexing) are always faster than same operations with string storage: numeric is smaller than corresponding string<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/7fac8898f9d4ef5afebc4eded763a6b8?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nfriism<br \/>\nphp .net codeigniter facebook-authentication appharbor<br \/>\nThe PHP application uses codeigniter framwork 2.2. How can we convert it so that it can be hosted in .net cloud hosting platform like AppHarbor which supports Phalanger converted PHP code.The PHP application also uses Facebook api for facebook-authentication which is not working. Not sure if this is the issue? $facebook-&gt;getUser() returns 0.We are not sure which assembly reference is missing?<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/c3db7dbce882cee2a8d15341176a6dd9?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nMichal W<br \/>\nandroid facebook facebook-graph-api facebook-android-sdk facebook-authentication<br \/>\nSometimes (not very frequently) my android app crashes after first logging to facebook using Facebook Login (Facebook SDK version 3.5). I&#8217;m getting exception: java.lang.RuntimeException: Unable to resume activity {my.app.package\/com.facebook.LoginActivity}: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=64206, result=0, data=null} to activity {my.app.package\/com.facebook.LoginActivity}: java.lang.NullPointerExceptionwith 2 different root exceptions:Sometimes w<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/9f7e4046c9835840862c86e7b9e0900d?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nJimmy Sawczuk<br \/>\nc# .net facebook facebook-authentication<br \/>\nI&#8217;m writing a .NET app that runs on a Windows computer. It is not accessible through the browser. The problem is, I can&#8217;t authenticate like I should. I&#8217;m currently coding in C# .NET, more specific in C#.I have a webbrowser control on my form. The user logs on to facebook through this webbrowser control. After the logon, I start the authentication procedure. I then retreive a code.Here&#8217;s where it goes wrong. With this code I want to obtain an access token. The generated request URL looks like: ht<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/979eaa7aa8d6c3cc1e9ed2dc9f38bb74?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nMarco W.<br \/>\nandroid facebook facebook-graph-api facebook-authentication facebook-android-sdk<br \/>\nI&#8217;m using Facebook&#8217;s SDK for Android (latest version as of today). The code that is for authentication is the following:prefs = PreferenceManager.getDefaultSharedPreferences(this); facebook = new Facebook(FACEBOOK_APP_ID); String fbAccessToken = prefs.getString(&#8220;fb_access_token&#8221;, null); long fbAccessExpires = prefs.getLong(&#8220;fb_access_expires&#8221;, 0); if (fbAccessToken != null) {facebook.setAccessToken(fbAccessToken); } if (fbAccessExpires != 0) {facebook.setAccessExpires(fbAccessExpires); } if (!fa<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/0ebef12c4291184562dac09965bce808?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\ndigster<br \/>\nfacebook facebook-graph-api facebook-php-sdk facebook-apps facebook-authentication<br \/>\nI am using the following code to get permissions for my app(the code is in index.php)- &lt;?phprequire_once &#8220;sdk\/facebook.php&#8221;;$fbconfig[&#8216;appid&#8217;] = &#8220;333446170045623&#8221;;$fbconfig[&#8216;secret&#8217;] = &#8220;9ea7b92bc7eac852a3900e1d7931c34d&#8221;;$facebook = new Facebook(array(&#8216;appId&#8217; =&gt; $fbconfig[&#8216;appid&#8217;],&#8217;secret&#8217; =&gt; $fbconfig[&#8216;secret&#8217;],&#8217;cookie&#8217; =&gt; true,));$user = $facebook-&gt;getUser();if (!$user) { \/* If user not found, authenticate *\/ $loginUrl = $facebook-&gt;getLoginUrl(array(&#8216;scope&#8217; =&gt; &#8216;publish_stre<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/QYFYK.jpg?s=32&amp;g=1\" \/><br \/>\nJeevan Dongre<br \/>\njavascript facebook facebook-graph-api oauth-2.0 facebook-authentication<br \/>\nI am trying out this example http:\/\/thinkdiff.net\/facebook\/new-javascript-sdk-oauth-2-0-based-fbconnect-tutorial\/But I am getting xml error which says permission denied.I have changed the application ID also. I am bit confused about the new UI of developers.facebook.com I was comfortable with the old UI. I am not sure where I dont mention my call back url.Kindly help me out.&lt;div id=&#8221;fb-root&#8221;&gt;&lt;\/div&gt;&lt;script type=&#8221;text\/javascript&#8221;&gt;var button;var userInfo;window.fbAsyncInit = funct<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/df550f1b554f31550340ad779e4a1671?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nThuglife<br \/>\njavascript facebook facebook-graph-api facebook-authentication<br \/>\nI have been working on integrating Facebook Login with my website, and so far I&#8217;ve been succeeding for the most part; however, I still have few doubts.On my homepage; I have a button an a href that will trigger a Javascript function that will prompt the user with a pop-up window to login to Facebook; if it&#8217;s the first time, the user will be prompted with another pop-up window that asks for permissions!After the user logs in (and accepts permission); (s)he will be redirected to another page using<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/072d9a026068ebfb9292d6c2aada071d?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nuser1072337<br \/>\nproperties laravel-4 facebook-authentication<br \/>\nI have an authentication system for Facebook login in Laravel that works fine when a user with all of the properties logs in, but when a user doesn&#8217;t have one of the properties filled out, it throws an error (for example):Undefined property: stdClass::$bio Here is the relevant code:Facebook.php:public function get_user_info(Token_Access $token){$url = &#8216;https:\/\/graph.facebook.com\/me?&#8217;.http_build_query(array(&#8216;access_token&#8217; =&gt; $token-&gt;access_token,));$user = json_decode(file_get_contents($url<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/647d5c1a95c5ad04a68683971023d684?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nRucha Heda<br \/>\nandroid eclipse facebook facebook-android-sdk facebook-authentication<br \/>\nI followed the login authentication tutorial on Facebook and have copied the following code into my android applicationprivate Session.StatusCallback callback = new Session.StatusCallback() {@Overridepublic void call(Session session, SessionState state, Exception exception) {onSessionStateChange(session, state, exception);} };However, it is giving me the following errors:Session.StatusCallback cannot be resolved to a typeWhich is leading to the following errors:callback cannot be resolved to a v<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/3a492b5afe6015b1963ee99f38987b8b?s=32&amp;d=identicon&amp;r=PG&amp;f=1\" \/><br \/>\nSangram Singh<br \/>\nnode.js facebook-authentication passport<br \/>\nIn the below code the &#8216;console.log(&#8216;this does not print!&#8217;)&#8217; statement does not execute. It should execute according to the FacebookStrategy.passport.use( new FacebookStrategy({clientID: FACEBOOK_APP_ID, clientSecret: FACEBOOK_APP_SECRET, callbackURL: &#8220;\/home&#8221;}, function(identifier, profile, done) {process.nextTick(function () {console.log(&#8216; This does not print!&#8217;);return done(null, profile);} );}));Basically, the authentication thru passport-facebook takes place but I am not able to recover any pr<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/9410f718829e0863f034f07bf45c690d?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nertan<br \/>\nruby-on-rails devise omniauth facebook-authentication<br \/>\nI followed the steps that are described in https:\/\/github.com\/plataformatec\/devise\/wiki\/OmniAuth:-Overview and have a method in user model like this:def self.find_for_facebook_oauth(access_token, signed_in_resource=nil)data = access_token.extra.raw_infoif user = self.find_by_email(data.email)userelse # Create a user with a stub password. self.create!(:email =&gt; data.email, :password =&gt; Devise.friendly_token[0,20]) end endI intermittently get errors likeA NoMethodError occurred in omniauth_c<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/941b4d4920facbe1513cd6a79fd30443?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nuser1147995<br \/>\nfacebook codeigniter facebook-apps facebook-authentication<br \/>\nI am trying to use facebook registration plugin with following code &lt;?phpdefine(&#8216;FACEBOOK_APP_ID&#8217;, &#8216;your_app_id&#8217;);define(&#8216;FACEBOOK_SECRET&#8217;, &#8216;your_app_secret&#8217;);function parse_signed_request($signed_request, $secret) {list($encoded_sig, $payload) = explode(&#8216;.&#8217;, $signed_request, 2); \/\/ decode the data$sig = base64_url_decode($encoded_sig);$data = json_decode(base64_url_decode($payload), true);if (strtoupper($data[&#8216;algorithm&#8217;]) !== &#8216;HMAC-SHA256&#8217;) {error_log(&#8216;Unknown algorithm. Expected HMAC-SHA25<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/107ecf299f6b6bc92382a5674fd1856b?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nrlc<br \/>\nandroid facebook-authentication<br \/>\nI am developing an Android app which requires authentication via facebook account. For the authentication, I used the Tutorial and Project provided by FacebookWhen the mobile does not have the standard facebook app already installed, the authentication works perfectly and my application works. On the other hand, if the mobile has the Facebook application installed, my application stops working and it goes straight to facebook app after the authentication.Does anyone knows how can i solve that?<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/c6a0ac3e18f1cd8d0f1be4c2e3a4cfbd?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nLiam<br \/>\nsecurity curl ssl-certificate facebook-oauth facebook-authentication<br \/>\nFatal error: Uncaught CurlException: 60: Peer certificate cannot be authenticated with known CA certificates thrown in \/home\/ldr\/public_html\/src\/base_facebook.php on line 886See: http:\/\/ldr.x10.bz\/examples\/with_js_sdk.phpI&#8217;ve been getting this error for 2 days now and can&#8217;t find any information on where it has come from? Why is the certificate known and is there a way for it to be unknown again?It had been working for months previously, so not sure if the API has just updated but I&#8217;ve deleted e<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/d5a4a552c332d5ffba49d9aa720fc376?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nMatschi<br \/>\nfacebook facebook-javascript-sdk facebook-authentication<br \/>\nHi, i am puzzled about an Facebook-Error that has been recently popping up in my (newer) applications: The apps are working fine, until i disable sandbox mode and try to test the app as a normal user. When clicking the login-button as normal user i get: &#8220;An error occured. Please try again later&#8221; or sometimes : &#8220;API Error Description: An unknown error occurred Error Message: kError 1349045: An invalid Platform session was found.: An invalid Platform session was found.&#8221; Sometimes the normal Permis<\/li>\n<\/ul>\n<p>Web site is in building<\/p>\n","protected":false},"excerpt":{"rendered":"<p>ns-keip database facebook authentication facebook-authentication Users of my application can authenticate via Facebook, so I store facebook uids in my database and when user logs in I need to query my database like this:SELECT * FROM users WHERE uid = _SOME_UID_;Now uid column is VARCHAR, but I think that I need to convert it to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,1],"tags":[],"class_list":["post-5710","post","type-post","status-publish","format-standard","hentry","category-laravel","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5710","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=5710"}],"version-history":[{"count":1,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5710\/revisions"}],"predecessor-version":[{"id":8862,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5710\/revisions\/8862"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=5710"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=5710"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=5710"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}