Note that there are some explanatory texts on larger screens.

plurals
  1. PORails omniauth-facebook unsolved issue
    primarykey
    data
    text
    <p>The current omniauth-facebook seems to have some issues, and I want to know if anyone has answers to them.</p> <p>First issue was the <strong>invalid credentials</strong> problem. I couldn't log in to my application using the client-side authorization because of this problem. However, this could be solved by downgrading facebook-omniauth to 1.4.0 version. <a href="https://stackoverflow.com/questions/11597130/omniauth-facebook-keeps-reporting-invalid-credentials">(reference</a>)</p> <p>However, now I'm encountering second problem, <strong>NoAuthorizationCodeError</strong>, with the error message:</p> <pre><code>OmniAuth Strategies Facebook NoAuthorizationCodeError (must pass either a `code` parameter or a signed request (via `signed_request` parameter): </code></pre> <p>this was asked in <a href="https://stackoverflow.com/questions/12370056/omniauth-strategies-facebook-noauthorizationcodeerror-must-pass-either-a-code">here</a>, but the accepted answer advises to actually <strong>upgrade</strong> to 1.4.1 version again, which would make the previous invalid credentials problem occur again. So this is not an option for me.</p> <p>The <code>NoAuthorizationCodeError</code> happens when I try to log into my application inside the Facebook iFrame (searched my app from the app center) via <strong>internet explorer</strong>. Everything works fine on chrome or firefox. There's also a <a href="https://github.com/mkdynamic/omniauth-facebook/issues/56" rel="nofollow noreferrer">github issue</a> exactly pinpointing this problem, but no one has come up with an answer yet. I've also tried to downgrade to omniauth-facebook 1.3.0 version, but it made no difference. I also tried to pass in the <code>signed_request</code> parameter like follows:</p> <pre><code>window.location = '/auth/facebook/callback', { signed_request: response.authResponse.signedRequest } </code></pre> <p>However, it didn't make any difference (on IE, the error still persists), and I'm not sure if that is the right way to pass in the code as a parameter (how do I check?)</p> <p>I assume there is no problem with my settings. I would really appreciate any help on this matter.</p> <p><em>UPDATE:</em></p> <p>I upgraded to 1.4.1 version without having invalid credentials problem, but NoAuthorizationCodeError still occurs when I access the application inside Facebook through Internet Explorer. Check my Github <a href="https://github.com/mkdynamic/omniauth-facebook/issues/110" rel="nofollow noreferrer">issue</a>.</p> <p><strong>UPDATE:</strong></p> <p>I downgraded to 1.4.0 version, and added signedRequest params.</p> <pre><code>&lt;script&gt; function login() { FB.login(function(response) { if (response.authResponse) { window.location = '/auth/facebook/callback?' + $.param({ signed_request: response.authResponse.signedRequest }) } }, {scope: 'email,publish_stream,publish_actions'}); } &lt;/script&gt; </code></pre> <p>There are no errors or alerts in the log, and everything works as expected. However, if I log in within Facebook iFrame through internet explorer, it does not log me in even after the callback phase is initiated. I guess the original problem has been solved but I can't figure out how to debug this when there is not any kind of error message.</p> <p><strong>Problem</strong>: When I click "log in with Facebook" inside Facebook iFrame for my application with Internet Explorer, I'm NOT logged in when the authorization process completes. This problem only happens in that specific environment, and I have had hard time trying to figure out why.</p> <pre><code>2013-02-22T01:10:40+00:00 app[web.1]: Started GET "/auth/facebook/callback?signed_request=LONGSTRING" for 200.1.102.103 at 2013-02-22 01:10:40 +0000 2013-02-22T01:10:40+00:00 app[web.1]: (facebook) Callback phase initiated. 2013-02-22T01:10:40+00:00 app[web.1]: Processing by SessionsController#create_facebook as HTML 2013-02-22T01:10:40+00:00 app[web.1]: Parameters: {"signed_request"=&gt;"LONGSTRING", "provider"=&gt;"facebook"} 2013-02-22T01:10:40+00:00 app[web.1]: User Load (1.6ms) SELECT "users".* FROM "users" WHERE "users"."provider" = 'facebook' AND "users"."uid" = 'MYUID' LIMIT 1 2013-02-22T01:10:40+00:00 app[web.1]: (0.8ms) BEGIN 2013-02-22T01:10:40+00:00 app[web.1]: User Exists (1.0ms) SELECT 1 AS one FROM "users" WHERE ("users"."name" = 'MYNAME' AND "users"."id" != 3) LIMIT 1 2013-02-22T01:10:40+00:00 app[web.1]: (0.9ms) COMMIT 2013-02-22T01:10:40+00:00 app[web.1]: Redirected to http://MYAPP.COM 2013-02-22T01:10:40+00:00 app[web.1]: Completed 302 Found in 10ms (ActiveRecord: 4.2ms) </code></pre> <p>Again, in any other environment authorization works perfectly in all browsers. This problem only occurs when I try to <strong>log in within Facebook via Internet Explorer</strong>.</p> <p><strong>My Environment</strong>: omniauth-facebook 1.4.0, omniauth 1.1.1, oauth2 0.8.0, Rails 3.2.11</p> <p>I intentionally downgraded omniauth-facebook from 1.4.1 to 1.4.0 because of the <em>invalid credentials</em> error in the latest version.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload