Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not authenticate you. (Code 32) #48

Open
shahryarjb opened this issue Mar 30, 2022 · 8 comments
Open

Could not authenticate you. (Code 32) #48

shahryarjb opened this issue Mar 30, 2022 · 8 comments

Comments

@shahryarjb
Copy link

shahryarjb commented Mar 30, 2022

Steps to Reproduce

I added all the config README into my project, but I get Could not authenticate you. (Code 32) error when I want to redirect to twitter


Actual Result

** (exit) an exception was raised:
    ** (Ueberauth.Strategy.Twitter.OAuth.ApiError) Could not authenticate you. (Code 32)
        (ueberauth_twitter 0.4.1) lib/ueberauth/strategy/twitter/oauth.ex:82: Ueberauth.Strategy.Twitter.OAuth.request_token!/2
        (ueberauth_twitter 0.4.1) lib/ueberauth/strategy/twitter.ex:18: Ueberauth.Strategy.Twitter.handle_request!/1
        (mishka_social 0.1.0) lib/auth/handel_request.ex:10: MishkaSocial.Auth.HandelRequest.handle_social_sender/1
        (mishka_html 0.1.0) lib/mishka_html_web/controllers/auth_controller.ex:1: MishkaHtmlWeb.AuthController.action/2
        (mishka_html 0.1.0) lib/mishka_html_web/controllers/auth_controller.ex:1: MishkaHtmlWeb.AuthController.phoenix_controller_pipeline/2
        (phoenix 1.6.6) lib/phoenix/router.ex:355: Phoenix.Router.__call__/2
        (mishka_html 0.1.0) lib/plug/error_handler.ex:80: MishkaHtmlWeb.Router.call/2
        (mishka_html 0.1.0) lib/mishka_html_web/endpoint.ex:1: MishkaHtmlWeb.Endpoint.plug_builder_call/2
        (mishka_html 0.1.0) lib/plug/debugger.ex:136: MishkaHtmlWeb.Endpoint."call (overridable 3)"/2
        (mishka_html 0.1.0) lib/mishka_html_web/endpoint.ex:1: MishkaHtmlWeb.Endpoint.call/2
        (phoenix 1.6.6) lib/phoenix/endpoint/cowboy2_handler.ex:54: Phoenix.Endpoint.Cowboy2Handler.init/4
        (cowboy 2.9.0) /Users/shahryar/Desktop/mishka-cms/deps/cowboy/src/cowboy_handler.erl:37: :cowboy_handler.execute/2
        (cowboy 2.9.0) /Users/shahryar/Desktop/mishka-cms/deps/cowboy/src/cowboy_stream_h.erl:306: :cowboy_stream_h.execute/3
        (cowboy 2.9.0) /Users/shahryar/Desktop/mishka-cms/deps/cowboy/src/cowboy_stream_h.erl:295: :cowboy_stream_h.request_process/3
        (stdlib 3.16.1) proc_lib.erl:226: :proc_lib.init_p_do_apply/3

I do not know this PR #38 fix this or not, it has conflict and I think it is old. It should be noted, GitHub and google work.

@michelson
Copy link

same error here, did you find a solution?

@benvp
Copy link

benvp commented Aug 26, 2022

This is because you are probably using the clientId and clientSecret which is provided by twitter. This lib expects the consumer_key and consumer_secret.

Also make sure that you have "Elevated Access" with your Twitter API (by requesting it), so that you can Sign In via OAuth1.

@michelson
Copy link

I've created a Twitter implementation for the v2.0, it uses the oauth2 package:
https://github.com/rauversion/rauversion-phx/tree/main/lib/rauversion/ueberauth/twitter
It lives on a repo right now but I guess it could be extracted to a new package. What do you think?

@yordis
Copy link
Member

yordis commented Aug 26, 2022

Maybe create a PR @michelson I am not too familiar with the twitter details so help is much appreciate here

@michelson
Copy link

how should this PR be designed in order to support both versions? maybe a TwitterV2 module? twitter_v2/folder?
maybe it would make more sense to create a new package?
let me know.

@yordis
Copy link
Member

yordis commented Aug 26, 2022

ideally avoid breaking changes, is this because of two different APIs? In that case, yeah, probably create a different module until we can deprecate the old one.

Any idea about the deprecation from Twitter? What is the EOL of it?

@michelson
Copy link

ideally avoid breaking changes. Is this because of two different APIs? In that case, yeah, probably create a separate module until we can deprecate the old one.

Any idea about the deprecation from Twitter? What is the EOL of it?

The V1 will not be deprecated AFAIK, so that a different module will be needed.

@benvp
Copy link

benvp commented Aug 27, 2022

ideally avoid breaking changes. Is this because of two different APIs? In that case, yeah, probably create a separate module until we can deprecate the old one.

Any idea about the deprecation from Twitter? What is the EOL of it?

The V1 will not be deprecated AFAIK, so that a different module will be needed.

Exactly. Quite a few endpoints are still v1 only (e.g update_profile) so a v2 package is preferable I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants