ueberauth / ueberauth_example

Example Phoenix application using Überauth for authentication
http://ueberauth-example.herokuapp.com
MIT License
220 stars 73 forks source link

Failed to authenticate #17

Closed limhanchung closed 8 years ago

limhanchung commented 8 years ago

Hello

I tried running the example with Facebook but I still get failed to authenticate. Why is that? [debug] Processing by UeberauthExample.AuthController.request/2 Parameters: %{"provider" => "facebook"} Pipelines: [:browser] [info] Sent 302 in 1ms [debug] UeberauthExample.AuthController halted in Ueberauth.call/2 [info] GET /auth/facebook/callback [debug] Processing by UeberauthExample.AuthController.callback/2 Parameters: %{"code" => "AQB0kWhD619CpLsWrgSWunwxFqK0ZyJuBGKe-8AqErrGJsKbjvgGQg7-ezGsMu22A8DPSCB-Ykir-NJ3PEsgpDAjX3ZyFL9iIHgicc61Pghf6be3mn41derQwfUdLfTkD73qWjKxHm84DA-2QV3V5AjHyHZf1JpGpCbmgdq0EnldcZqIKjOBe3YNl5UUSDa92dbiC4JBSKmnaGxRDy8S1NHZINFoF5UO_iqdObfecAoadSKAI4p5IExrjN9-P8LnZkEvm82ECgGd9AWfHkAYaUYjsnsFirYfKLJjg7k9O6FQN4FfU160nUC6XN7P4KjnJr45abdtHdpFQSonyztrBwSw", "provider" => "facebook"} Pipelines: [:browser]

limhanchung commented 8 years ago

I figured it out. My app secret was incorrect.

cmdallas commented 5 years ago

To add some color in case somebody else runs into this:

Ensure that your Ueberauth id/secret are correct. In my case, I never added env variables to the server I deployed my code to.

Ex:

config :ueberauth, Ueberauth.Strategy.Github.OAuth,
  client_id: System.get_env("GITHUB_OAUTH_CLIENT"),
  client_secret: System.get_env("GITHUB_OAUTH_SECRET")