Skip to content

Not_Authed Issue with Token Parameter vs Header Authorization Bearer #268

Description

@lf73

All requests result in a not_authed result. My existing code was working until I had to delete and recreate an app in Slack due to a user change. I have noticed that the BOT token is now longer.

Using the Slack API tester, I can successfully post a message to a channel. I compared what is sent in the Slack API test with what is being sent through the "SlackAPI" in C# using Fiddler. I found that Token is being used as a parameter versus using the recommended Authorization Bearer as an HTTP header.

Can SlackAPI be adjusted to use the Authorization Bearer?

Activity

  1. lf73 commented on Feb 28, 2021

    @lf73
    Author

    https://api.slack.com/web#authentication does indicate that while a bearer token is preferred &Token = should work.

    The format of my original token
    xoxb-123456789012-abcalphanumericabcacbddd

    And new token
    xoxb-12345678901-1234567890123-abcalphanumericgfdgsdgff

    So perhaps this might be a bug in Slack not allowing the proper length in their parameter.

  2. changed the title [-]Not_Authed[/-] [+]Not_Authed Issue with Token Parameter vs Header Authorization Bearer[/+] on Feb 28, 2021
  3. lf73 commented on Feb 28, 2021

    @lf73
    Author

    Received a response from Slack Tech Support than Token is no longer supported for newly created apps.

    https://api.slack.com/changelog/2021-02-24-how-we-broke-your-slack-app

    Web API method authentication changes
    Newly created Slack apps and custom integrations may no longer send token as a query string parameter and must send it instead as a POST parameter or better yet, a HTTP Authorization header. Existing apps may continue doing what they already do.

    Here's what you need to know.
    If you create a new app or legacy custom integration-based bot (or hubot), you'll need to send token to us the preferred way.
    If you use a rare kind of blueprint-based app, newly created apps from that blueprint must also follow this rule.
    There is no impact to existing apps.

  4. maxsgit1234 commented on Mar 4, 2021

    @maxsgit1234

    I believe I encountered this problem as well trying to post a message using a newly created app. Calls to SlackClient.PostMessage result in a PostMessageResponse with error 'invalid_auth'. Using the 'Tester' tab on the Slack website (https://api.slack.com/methods/chat.postMessage/test) works fine for the new app.

  5. ifonya105 commented on Mar 5, 2021

    @ifonya105

    Pull request is created.
    #270

  6. SanderFasen commented on Mar 11, 2021

    @SanderFasen

    Thanks for the PR @ifonya105 . I also walked into this issue today. Good to see someone had taken the time to investigate and fix :-). Hope it will be merged soon!

  7. kris-carlgren commented on Mar 18, 2021

    @kris-carlgren

    Yep.. blocking issue. First experience with C# and slack today, and this really killed it. At least there is a fix :)

  8. LordOfSkighaugh commented on Mar 24, 2021

    @LordOfSkighaugh

    Yesterday was also my first attempt at Slack integration with C#. Also blocked.

  9. ifonya105 commented on Mar 29, 2021

    @ifonya105

    Pull request is approved.
    Thank you to all the participants!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions