Closed hok closed 4 years ago
Actually this code is in Assent so I might have created this ticket in the wrong place.
The failure happens in deps/assent/lib/assent/strategies/oauth.ex:208, on the get
line:
def get_user(config, token) do
with {:ok, url} <- Config.fetch(config, :user_url) do
config
|> get(token, url)
|> process_user_response()
end
end
I think it's because query params was not passed on to the Mint request. Can you try with Mint again, using this branch in mix.exs
?
{:assent, github: "pow-auth/assent", ref: "fix-mint-query", override: true}
It hopefully solves the issue 😄
It does work with the fix branch.
Thanks for looking into it. Pow and PowAssent are awesome libraries.
Assent v0.1.5
released with the fix 🚀
I was adding PowAssent using Twitter strategy and the authentication process worked until the
get_user
function was called, at which point Twitter returned{ "code": 32, "message": "Could not authenticate you." }
I was using Mint 1.0 as the HTTP client. During debugging I went back to
httpc
, which fixed the issue. It might be some kind of encoding problem but I couldn't make it work so far using Mint.