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

Authentication does not work with new Apps #114

Open
simonfagerholm opened this issue Apr 19, 2021 · 6 comments
Open

Authentication does not work with new Apps #114

simonfagerholm opened this issue Apr 19, 2021 · 6 comments

Comments

@simonfagerholm
Copy link

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
Copy link
Author

I created a PR for the slack recommended header method

simonfagerholm added a commit to simonfagerholm/PSSlack that referenced this issue Apr 21, 2021
* Move token to header in Send-SlackAPI RamblingCookieMonster#114

Solves breaking change in https://api.slack.com/changelog/2020-11-no-more-tokens-in-querystrings-for-newly-created-apps=0

* Update Get-SlackHistory to use conversation.history

Remove use of deprecated channel.history https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api#methods

* Replace mention of channels.list with conversations.list

* Rewrite functions using deprecated groups API.

Fixes RamblingCookieMonster#113
@mhudson
Copy link

mhudson commented May 5, 2021

Patch confirmed working. Thanks @simonfagerholm 👍

@tstooke
Copy link

tstooke commented Nov 2, 2023

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.

@marcinpolanski
Copy link

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

@nascentt
Copy link

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.

@simonfagerholm
Copy link
Author

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

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

5 participants