apache / incubator-answer-plugins

The Apache Answer plugins repository.
https://answer.apache.org/plugins
Apache License 2.0
76 stars 48 forks source link

user-center-slack not_authed #254

Open Perondas opened 9 hours ago

Perondas commented 9 hours ago

After installing the user-center-slack plugin I tried connecting it to my workspace.

I gave the Slack app all the required scopes. When I click on the Sync Now button I get a toast with "failed to sync user data". This is accompanied by the following logs:

answer-1  | 2024-11-22 19:38:55.261 DEBUG   user-center-slack/handler.go:59 Get client ID:<SNIP>
answer-1  | 2024-11-22 19:38:55.261 DEBUG   user-center-slack/handler.go:74 RedirectURL from BuildSlackBaseRedirectURL:https://slack.com/oauth/v2/authorize?client_id=<SNIP>&scope=chat:write,commands,groups:write,im:write,incoming-webhook,mpim:write,users:read,users:read.email&response_type=code&redirect_uri=https://<SNIP>/answer/api/v1/user-center/login/callback&state=<SNIP>=&nonce=<SNIP>
answer-1  | 2024-11-22 19:38:56.978 INFO    user-center-slack/handler.go:139    start sync slack data
answer-1  | 2024-11-22 19:38:56.978 DEBUG   user-center-slack/client.go:180 Try to update slack client
answer-1  | 2024-11-22 19:38:57.335 ERROR   user-center-slack/client.go:162 Failed to get valid user info, Slack API error: not_authed
answer-1  | 2024-11-22 19:38:57.335 ERROR   user-center-slack/client.go:184 Failed to update user info: Get user info failed: not_authed
answer-1  | 2024-11-22 19:38:57.335 ERROR   user-center-slack/handler.go:144    list user error: Get user info failed: not_authed
LinkinStars commented 8 hours ago

By the way, Can users log in via Slack? I just want to make sure the config is correct.

FYI: https://github.com/apache/incubator-answer-plugins/tree/main/user-center-slack

Make sure

Note: A Redirect URL must also use HTTPS. You can configure a Redirect URL and scope in the App Management page under OAuth & Permissions.

Perondas commented 8 hours ago

Just tested the login, that seems to work. However, it prompts me to select a channel for the App to post in every time.

Perondas commented 8 hours ago

By the way, does the webhook need to be set by every individual user?

Perondas commented 8 hours ago

Just tested the login, that seems to work. However, it prompts me to select a channel for the App to post in every time.

It seems that it creates a new webhook for every login, just had to delete a couple.