PSSlack icon indicating copy to clipboard operation
PSSlack copied to clipboard

Authentication does not work with new Apps

Open simonfagerholm opened this issue 3 years ago • 6 comments

The way PSSlack send the token to slack is no longer supported on newly created apps: https://api.slack.com/changelog/2020-11-no-more-tokens-in-querystrings-for-newly-created-apps=0

I have confirmed this with slack support.

The Invoke-RestMethod call should either be changed to use arguments -Method POST (confirmed to work) or the token should be included in an authorization header: Header = @{ Authorization = "Bearer $Token" } (also confirmed to word).

Both ways should be backwards compatible according to documentation

simonfagerholm avatar Apr 19 '21 14:04 simonfagerholm

I created a PR for the slack recommended header method

simonfagerholm avatar Apr 20 '21 05:04 simonfagerholm

Patch confirmed working. Thanks @simonfagerholm 👍

mhudson avatar May 05 '21 12:05 mhudson

Hello wonderful people! I was wondering if this PR made it to being published in PSGallery? Looks like version 1.0.6 out there still has the older token handling? This package is awesome and just what we need to simplify our Slack integration, but we really need it to work with newer Slack Apps.

tstooke avatar Nov 02 '23 19:11 tstooke

same here, authentication for me does not work on a newly created app.

marcinpolanski avatar Dec 01 '23 21:12 marcinpolanski

Any reason why Simon's fixes haven't been merged to master?

After wasting time trying to get psslack working I found Simon's fork which works perfectly.

nascentt avatar Feb 27 '24 10:02 nascentt

@nascentt Post in the PR to get the attention of the repo owner 👍

simonfagerholm avatar Feb 27 '24 10:02 simonfagerholm