Code Monkey home page Code Monkey logo

Comments (13)

msaurabhee avatar msaurabhee commented on May 20, 2024 1

So my issue was callback_url was coming as http:// not https which was registered on facebook.

So I passed facebook strategy as following:

      {Ueberauth.Strategy.Facebook,
       [
         auth_type: "rerequest",
         callback_scheme: "https"
       ]},

To use the above strategy, you must use ueberauth 0.8.0 which is not published on hex. Use it as:

{:ueberauth, "~> 0.8.0", github: "ueberauth/ueberauth", branch: "master", override: true},

from ueberauth_facebook.

ahallock avatar ahallock commented on May 20, 2024

Looks like the underlying error is:

Can't Load URL: The domain of this URL isn't included in the app's domains. To be able to load this URL, add all domains and subdomains of your app to the App Domains field in your app settings.

from ueberauth_facebook.

yordis avatar yordis commented on May 20, 2024

@ahallock is that Facebook configuration setting issue? I am not sure of this issue honestly.

from ueberauth_facebook.

ahallock avatar ahallock commented on May 20, 2024

@yordis It must be. I've tried every combination I could think of. It's supposed to work with localhost afaik, but I can't make it past this error for my local. I set both app domain and Site URL:
Screen Shot 2022-01-24 at 11 39 40 PM
Screen Shot 2022-01-24 at 11 39 47 PM

from ueberauth_facebook.

yordis avatar yordis commented on May 20, 2024

@ahallock is this Intellectual Property? Or something open-source and/or we can pair on it?

I see a lot of issues from people with Facebook providers lately, and it is hard to figure out what is actually broken.

from ueberauth_facebook.

ahallock avatar ahallock commented on May 20, 2024

@yordis it's just a basic project I'm using to learn -- no IP. Would be happy to pair on it.

from ueberauth_facebook.

talhaazeem-invozone avatar talhaazeem-invozone commented on May 20, 2024

I am having the same issue. I truncated the user table and then tried to do login again it gave me the same error.

from ueberauth_facebook.

shahryarjb avatar shahryarjb commented on May 20, 2024

Unfortunately, I have the same issue

%Ueberauth.Failure{
  errors: [
    %Ueberauth.Failure.Error{
      message: "The code has been used or has expired",
      message_key: "invalid_code"
    }
  ],
  provider: :facebook,
  strategy: Ueberauth.Strategy.Facebook
}

I set localhost in my test app

I test directly

IO.inspect Ueberauth.Strategy.Facebook.OAuth.get_token!([code: code], [])

and I have this error:

www-authenticate: OAuth "Facebook Platform" "invalid_code" "Error validating verification code. Please make sure your redirect_uri is identical to the one you used in the OAuth dialog request"

from ueberauth_facebook.

msaurabhee avatar msaurabhee commented on May 20, 2024

I am having this same issue. Looks like something changed on facebook side?

from ueberauth_facebook.

msaurabhee avatar msaurabhee commented on May 20, 2024

How can I become a contributor? I need to commit this change:

diff --git a/lib/ueberauth/strategy/facebook.ex b/lib/ueberauth/strategy/facebook.ex
index 462a5ad..f708bfe 100644
--- a/lib/ueberauth/strategy/facebook.ex
+++ b/lib/ueberauth/strategy/facebook.ex
@@ -65,8 +65,7 @@ defmodule Ueberauth.Strategy.Facebook do
         fetch_user(conn, client, config)
       end
     rescue
-      OAuth2.Error ->
-        set_errors!(conn, [error("invalid_code", "The code has been used or has expired")])
+      e -> set_errors!(conn, [error("get_token_error", e)])
     end
   end

from ueberauth_facebook.

shahryarjb avatar shahryarjb commented on May 20, 2024

@msaurabhee fork this project and change the lines you want and after that send a pull request to this repo 🤔

from ueberauth_facebook.

msaurabhee avatar msaurabhee commented on May 20, 2024

Already done #70

from ueberauth_facebook.

yordis avatar yordis commented on May 20, 2024

#70 got merged, feel free to reopen the ticket

from ueberauth_facebook.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.