huginn: Unable to create Twitter service

I have just installed Huginn on Debian Stretch, install was from source using the following instructions - https://github.com/huginn/huginn/blob/master/doc/manual/installation.md

Twitter keys were added to .env file and the Huginn server is up and working, however when i click the “Authenticate with Twitter” button on the services tab, i enter my Twitter credentials, confirm MFA, then get the message that I am being redirected back to the application, the screen refreshes and I am back at the Services tab, nothing listed under “provider” and when i try to create a twitter stream agent, there are no services in the dropdown box.

The authentication and communication with Huginn seems to be working based on the log in the production.log:

I, [2022-03-23T18:30:02.856272 #30857]  INFO -- : 2022-03-23T18:30:02+1300: [Worker(host:****** pid:30857)] 5 jobs processed at 32.6122 j/s, 0 failed
I, [2022-03-23T18:30:09.740510 #30899]  INFO -- : [267d67c4-309a-45a6-a5a9-8c6c81d74d61] Started GET "/auth/twitter/callback?oauth_token=************&oauth_verifier=****************" for 127.0.0.1 at 2022-03-23 18:30:09 +1300
I, [2022-03-23T18:30:09.741086 #30899]  INFO -- : [267d67c4-309a-45a6-a5a9-8c6c81d74d61] (twitter) Callback phase initiated.
I, [2022-03-23T18:30:11.190779 #30899]  INFO -- : [267d67c4-309a-45a6-a5a9-8c6c81d74d61] Processing by OmniauthCallbacksController#twitter as HTML
I, [2022-03-23T18:30:11.190949 #30899]  INFO -- : [267d67c4-309a-45a6-a5a9-8c6c81d74d61]   Parameters: {"oauth_token"=>"****************", "oauth_verifier"=>"*************"}
I, [2022-03-23T18:30:11.201425 #30899]  INFO -- : [267d67c4-309a-45a6-a5a9-8c6c81d74d61] Redirected to https://*************.com/services
I, [2022-03-23T18:30:11.201726 #30899]  INFO -- : [267d67c4-309a-45a6-a5a9-8c6c81d74d61] Completed 302 Found in 11ms (ActiveRecord: 1.7ms | Allocations: 2192)
I, [2022-03-23T18:30:11.439621 #30898]  INFO -- : [6de0347a-729c-446b-9b1e-71739aa7a6d4] Started GET "/services" for 127.0.0.1 at 2022-03-23 18:30:11 +1300
I, [2022-03-23T18:30:11.440922 #30898]  INFO -- : [6de0347a-729c-446b-9b1e-71739aa7a6d4] Processing by ServicesController#index as HTML
I, [2022-03-23T18:30:11.449767 #30898]  INFO -- : [6de0347a-729c-446b-9b1e-71739aa7a6d4]   Rendering services/index.html.erb within layouts/application
I, [2022-03-23T18:30:11.452593 #30898]  INFO -- : [6de0347a-729c-446b-9b1e-71739aa7a6d4]   Rendered services/index.html.erb within layouts/application (Duration: 2.6ms | Allocations: 705)
I, [2022-03-23T18:30:11.455337 #30898]  INFO -- : [6de0347a-729c-446b-9b1e-71739aa7a6d4]   Rendered layouts/_navigation.html.erb (Duration: 1.8ms | Allocations: 751)
I, [2022-03-23T18:30:11.455748 #30898]  INFO -- : [6de0347a-729c-446b-9b1e-71739aa7a6d4]   Rendered layouts/_messages.html.erb (Duration: 0.1ms | Allocations: 18)
I, [2022-03-23T18:30:11.456162 #30898]  INFO -- : [6de0347a-729c-446b-9b1e-71739aa7a6d4]   Rendered application/_upgrade_warning.html.erb (Duration: 0.1ms | Allocations: 5)
I, [2022-03-23T18:30:11.459814 #30898]  INFO -- : [6de0347a-729c-446b-9b1e-71739aa7a6d4] Completed 200 OK in 19ms (Views: 9.3ms | ActiveRecord: 2.4ms | Allocations: 4702)


If someone can please point out something I might be missing that would be really appreciated.

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 1
  • Comments: 28

Most upvoted comments

I can confirm that you need to

  • Create a dev account
  • Apply for elevated access
  • Create a “Standalone App” (OAuth 1.0a)
  • Enter the API Key and Secret (not ClientID and Secret)

…for this to work properly

I decided to do some playing around and spun up a very basic ruby on rails environment, and think I’ve figured out the potential cause. Twitter has several “access levels” based on your needs and what they’ll grant you to (see here). If you go to your twitter dashboard and look at your project, you may see it says “Essential” next to it. Based on that, and the allowed access levels, you no longer have access to OAuth 1.0a, which is what omniauth-twitter uses to authenticate, nor a number of the standard v1.1 API endpoints (note it says “limited access - only media endpoints”). The failure is actually upstream in the omniauth-twitter gem itself.

I suspect earlier apps/projects were grandfathered into the “Elevated”.

I’ll do some more tinkering and see if I can build something against omniauth-twitter2.