1

I'm utilizing Ueberauth in a library I'm building to simplify the addition of authentication in Phoenix.

I've setup an example repo and you can see the code at in the v2 branch

I’m attempting to implement the Ueberauth Identity strategy right now. It appears that although I’ve added the Ueberauth plug to the controller, the ueberauth_failure and ueberauth_auth are not being set in the conn’s assigns. Instead, conn.assigns is %{}.

I’m expecting that with this example curl request:

curl -i -X POST localhost:4000/identity/callback -d '{"user": {"email": "test@example.com", "password": "password"}}'

at least one of those (ueberauth_failure or ueberauth_auth) will be set?

Ueberauth is configured here: https://github.com/britton-jb/test_sentinel_example/blob/master/config/config.exs#L58

The controller implementing the strategy is https://github.com/britton-jb/sentinel/blob/v2/lib/sentinel/controllers/json/session_controller.ex

The controller and route are exposed in https://github.com/britton-jb/test_sentinel_example/blob/master/web/router.ex#L26

by this macro: https://github.com/britton-jb/sentinel/blob/v2/lib/sentinel.ex#L50

brittonjb
  • 502
  • 5
  • 15
  • Spoke with @hassox on the Elixir slack and he may found the likely culprit. Will update with answer following testing. – brittonjb Nov 02 '16 at 16:46

1 Answers1

2

@hassox suggested the correct solution, ueberauth identity's plug must be routed to /auth/identity/ and /auth/identity/callback, as soon as I changed the routing to reflect this everything worked.

brittonjb
  • 502
  • 5
  • 15
  • While it is true that the **default** path is `/auth`, it can be customised in the config (alteast in the newer versions of ueberauth) by setting `base_path: "/identity"` – Anuj Jun 02 '22 at 05:55