ueberauth / ueberauth

An Elixir Authentication System for Plug-based Web Applications
MIT License
1.62k stars 120 forks source link

Upgrading to 0.6.2 is potentially breaking #110

Closed tonnenpinguin closed 4 years ago

tonnenpinguin commented 5 years ago

After updating ueberauth from 0.6.1 to 0.6.2 the authentication requests for all providers (identity, facebook, google) stopped working and I started seeing the following error message.

(UndefinedFunctionError) function SSO.Web.AuthController.request/2 is undefined or private

This was quite hard to debug because everything worked normally as long as the individual apps all run on the root path (e.g. localhost:4000/). In production I am adding an additional path configuration in the phoenix configuration (--> localhost:4000/auth/) and this is when things seem to stop working.

Downgrading back to 0.6.1 gets everything back to working order.

Is there any config/path settings I have to change in order for this to work as before again?

doomspork commented 5 years ago

@yordis you've been involved in most of the recent releases, can insights here? @ueberauth/core this might be something we need to investigate.

yordis commented 5 years ago

Is there a version 0.6.2?

doomspork commented 5 years ago

Yes @yordis https://github.com/ueberauth/ueberauth/blob/master/mix.exs#L4

0x6a68 commented 5 years ago

@tonnenpinguin Hi ;)

could share your config :ueberauth ? i am guessing that the composition of request_path might be wrong.

tonnenpinguin commented 5 years ago

Hi @0x6a6f74726f !

Sure thing:

config :ueberauth, Ueberauth,
  providers: [
    identity: {
      Ueberauth.Strategy.Identity,
      [
        callback_methods: ["POST"],
        param_nesting: "user",
        name_field: :display_name
      ]
    },
    google: {Ueberauth.Strategy.Google, [default_scope: "email profile"]},
    facebook: {Ueberauth.Strategy.Facebook, [default_scope: "email,public_profile"]}
  ]
0x6a68 commented 5 years ago

Thanks for sharing. I suggest you add the base_path option.

an example

config.exs

...
config :ueberauth, Ueberauth,  
   base_path: "/",
   ...

corresponding router.ex

  ...
  scope "/", SSO.Web do
    ...
    get("/:provider", AuthController, :request)
    ...
  end
Hanspagh commented 4 years ago

Sounds like a misconfiguration, @tonnenpinguin feel free to reopen, if this is still a problem