Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Dan 1285 posts 3917 karma points c-trib
    Apr 17, 2013 @ 16:25
    Dan
    0

    uTwit '401 Unauthorized' gotchas

    Hi,

    I think I have an issue with how my app is set up on dev.twitter.com and wondered if anyone had any pointers on why the authorisation is failing.

    I've installed the uTwit datatype package on umbraco 4.9.1.  I've added a property to my site settings document type, which is fine.  It gives me a link to 'authorize'.  I click this and it opens a pop-up to confirm authorisation, which must be using the demo consumer key/secret.  All good, so I installed the uTwit web package and coded my macro to display the latest x tweets.  However, I'd like to use my own twitter app account as recommended rather than using the shared one for the uTwit demo, so I logged in at dev.twitter.com and created an app.  It gives me the consumer key/secret and access token/secret etc.  I enter my consumer key and secret into the uTwit data type and try to authorize again to make it use my app account, but this time the pop-up gives a 401 Unauthorized error.  I'm sure I've coped the key/secret correctly.

    Does anyone know what might be causing this?  Presumably there are some settings in my app account that aren't correct.  I've kept it pretty minimal though - I've only entered application name, description and website and left the rest default.  Do I need a different access type and/or callback URL etc?  Anything else that could be preventing the authorisation?

    Thanks folks!

    Edit: I've tried setting read/write access and adding the domain to the '@ Anywhere domains' list (using just the domain without http:// or www, else it doesn't save!) but still no joy.

  • Dan 1285 posts 3917 karma points c-trib
    Apr 17, 2013 @ 17:09
    Dan
    0

    I've just hard-coded the oAuthToken, oAuthTokenSecret, consumerKey, consumerKeySecret and screenName using values in the dev.twitter app, and that has worked.  It's not resolved the original issue but has bypassed it.

  • Matt Brailsford 4123 posts 22194 karma points MVP 9x c-trib
    Apr 17, 2013 @ 17:23
    Matt Brailsford
    102

    Hi Dan,

    You need to set the callback URL on the dev.twitter.com site for your app. uTwit doesn't use it, but for some reason twitter needs it to be set, otherwise you get the 401 you are seeing.

    Give that a try and see if it helps.

    Thanks

    Matt

  • Kunal 19 posts 116 karma points
    Feb 08, 2019 @ 23:26
    Kunal
    0

    Hi Matt,

    I am having the same issue. Sort of. Didn't realize I was using the demo keys until now. For some reason, when I tried to change the Authorization on the demo keys, I now get a 403 Forbidden.

    Any idea why the demo keys worked until now?

    Thanks!

  • Dan 1285 posts 3917 karma points c-trib
    Apr 17, 2013 @ 17:27
    Dan
    0

    Bingo!  Thanks Matt.

Please Sign in or register to post replies

Write your reply to:

Draft