Изменения версии Omniauth Facebook Api 2018 Ошибка: не удалось аутентифицировать вас из Facebook из-за «Неверные учетные данные» - PullRequest
0 голосов
/ 11 октября 2018

Я попробовал каждое решение этой проблемы.

1.) Обновив все 3 драгоценного камня omniauth

bundle update omniauth-google-oauth2 omniauth-facebook omniauth

2.) Добавив token_params: {parse::json}

config.omniauth :facebook, ENV['FACEBOOK_OMNIAUTH_CLIENT_ID'], ENV['FACEBOOK_OMNIAUTH_CLIENT_SECRET'], scope: 'public_profile, email', info_fields: 'email,first_name,last_name', token_params: { parse: :json }

3).Указывая версию Api

  config.omniauth :facebook, ENV['FACEBOOK_OMNIAUTH_CLIENT_ID'], ENV['FACEBOOK_OMNIAUTH_CLIENT_SECRET'], scope: 'public_profile, email', info_fields: 'email,first_name,last_name', token_params: { parse: :json },client_options: {
      site: 'https://graph.facebook.com/v3.1',  # this is the example API version
      authorize_url: "https://www.facebook.com/v3.1/dialog/oauth"
    }

Все еще получаю эту ошибку «Неверные учетные данные»

*Started GET "/users/auth/facebook/callback?code=AQDgxIKcfy9bvyQx25Co3KxMPimFt6zbQHbL-Yilk63xustHu_4cBtbhPjbpHq8eeYXG0wiD5FJIrZ5MUwzlc1BIIahXZ8WyYTz5_E1k7C165ttSG7CKK2fDkEa1V_1LcskKZZh-bXy5aVinnPOOoJSzfTN7vz-ZymbxfMr-bT_v3r7WpUjtZtYO3xR8JqBDp9rqB7EScdkYJvDgGqZ0V3w6gLhlCD1ae3xD54_vl04GQB3iBo9WnWlq5Br-JerORZD6qVUnD70_f5jC0diOorWK370uGxOKYwK_LBGfM8B-B_IQsw9IFRvk7u7hq_yaJhAuLRd-3iOrC3A8LDAz9SL6&state=aafc83cc91a92365969edf3f5f65431e2f788dd8aa691607" for 118.67.252.106 at 2018-10-11 17:42:06 +0530
I, [2018-10-11T17:42:07.014448 #8505]  INFO -- omniauth: (facebook) Callback phase initiated.
E, [2018-10-11T17:42:07.542530 #8505] ERROR -- omniauth: (facebook) Authentication failure! invalid_credentials: OAuth2::Error, <!DOCTYPE html>
<html lang="en" id="facebook">
  <head>
    <title>Facebook | Error</title>
    <meta charset="utf-8">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="cache-control" content="no-store">
    <meta http-equiv="cache-control" content="max-age=0">
    <meta http-equiv="expires" content="-1">
    <meta http-equiv="pragma" content="no-cache">
    <meta name="robots" content="noindex,nofollow">
    <style>
      html, body {
        color: #141823;
        background-color: #e9eaed;
        font-family: Helvetica, Lucida Grande, Arial,
                     Tahoma, Verdana, sans-serif;
        margin: 0;
        padding: 0;
        text-align: center;
      }

      #header {
        height: 30px;
        padding-bottom: 10px;
        padding-top: 10px;
        text-align: center;
      }

      #icon {
        width: 30px;
      }

      h1 {
        font-size: 18px;
      }

      p {
        font-size: 13px;
      }

      #footer {
        border-top: 1px solid #ddd;
        color: #9197a3;
        font-size: 12px;
        padding: 5px 8px 6px 0;
      }
    </style>
  </head>
  <body>
    <div id="header">
      <a href="//www.facebook.com/">
        <img id="icon" src="//static.facebook.com/images/logos/facebook_2x.png" />
      </a>
    </div>
    <div id="core">
      <h1 id="sorry">Sorry, something went wrong.</h1>
      <p id="promise">
        We're working on it and we'll get it fixed as soon as we can.
      </p>
      <p id="back-link">
        <a id="back" href="//www.facebook.com/">Go Back</a>
      </p>
      <div id="footer">
        Facebook
        <span id="copyright">
          &copy; 2018
        </span>
        <span id="help-link">
          &#183;
          <a id="help" href="//www.facebook.com/help/">Help Center</a>
        </span>
      </div>
    </div>
    <script>
      document.getElementById('back').onclick = function() {
        if (history.length > 1) {
          history.back();
          return false;
        }
      };

      // Adjust the display based on the window size
      if (window.innerHeight < 80 || window.innerWidth < 80) {
        // Blank if window is too small
        document.body.style.display = 'none';
      };
      if (window.innerWidth < 200 || window.innerHeight < 150) {
        document.getElementById('back-link').style.display = 'none';
        document.getElementById('help-link').style.display = 'none';
      };
      if (window.innerWidth < 200) {
        document.getElementById('sorry').style.fontSize = '16px';
      };
      if (window.innerWidth < 150) {
        document.getElementById('promise').style.display = 'none';
      };
      if (window.innerHeight < 150) {
        document.getElementById('sorry').style.margin = '4px 0 0 0';
        document.getElementById('sorry').style.fontSize = '14px';
        document.getElementById('promise').style.display = 'none';
      };
    </script>
  </body>
</html>

Processing by Users::OmniauthCallbacksController#failure as HTML
  Parameters: {"code"=>"AQDgxIKcfy9bvyQx25Co3KxMPimFt6zbQHbL-Yilk63xustHu_4cBtbhPjbpHq8eeYXG0wiD5FJIrZ5MUwzlc1BIIahXZ8WyYTz5_E1k7C165ttSG7CKK2fDkEa1V_1LcskKZZh-bXy5aVinnPOOoJSzfTN7vz-ZymbxfMr-bT_v3r7WpUjtZtYO3xR8JqBDp9rqB7EScdkYJvDgGqZ0V3w6gLhlCD1ae3xD54_vl04GQB3iBo9WnWlq5Br-JerORZD6qVUnD70_f5jC0diOorWK370uGxOKYwK_LBGfM8B-B_IQsw9IFRvk7u7hq_yaJhAuLRd-3iOrC3A8LDAz9SL6", "state"=>"aafc83cc91a92365969edf3f5f65431e2f788dd8aa691607"}
Redirected to https://39019a0d.ngrok.io/users/sign_in*

Пожалуйста, помогите мне решить эту проблему.Это заняло у меня целый день, а другой день точно такой же.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...