Alternative to Ueberauth for OAuth

Hello everyone,

I’m trying to implement user authentication using Github so I use Ueberauth with Ueberauth_github provider but the problem is Ueberauth_github depends on Poison but Phoenix 1.4 uses Jason and not Poison so probably adding Poison seems redundant imo.

So I’m asking if there are some libraries that I can use as replacement to Ueberauth particularly Ueberauth_github that uses Jason by default or the serializer can be change by the developer.

You’ve got to do more work yourself, but https://github.com/scrogson/oauth2 only has Poison as a test dependency. There’s also https://github.com/danschultzer/pow and https://github.com/danschultzer/pow_assent which have recently been updated for Phoenix 1.4. Either way it’s worth looking at Pow Assent for how the OAuth strategies are implemented.

2 Likes

The problem is that the main OAuth2 library still depends on Poison by default. I’m working on a proper fix for this with PowAssent as it also depends on oauth2.

You should be able to make it work by setting this in you config:

config :oauth2,
  serializers: %{
    "application/json" => Jason
  }
5 Likes

Really excited about pow

1 Like

Even on Phoenix 1.4, we still use Ueberauth and a few strategies.
IMHO Poison is still a requirement in a great number of other applications, so you will eventually need it.

1 Like

IMHO this is really a non issue, Ueberauth gives you a ton of integrations and you’ll end up doing a lot more work just to avoid a dependency.

1 Like

I don’t understand why adding another dependency is that big of an issue what if you need to support twitter auth then you will be adding another dependency (ueberauth_twitter), I would suggest just use ueberauth it is great package and it is widely used.