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

Installation from the Slack app directory is impossible, right? #732

Closed
4 of 10 tasks
MattB543 opened this issue Jan 7, 2021 · 2 comments
Closed
4 of 10 tasks

Installation from the Slack app directory is impossible, right? #732

MattB543 opened this issue Jan 7, 2021 · 2 comments
Labels
discussion M-T: An issue where more input is needed to reach a decision enhancement M-T: A feature request for new functionality question M-T: User needs support to use the project

Comments

@MattB543
Copy link

MattB543 commented Jan 7, 2021

Description

As the authentication state is required there is no way to install the app from the Slack app directory, right? The only way for users to install the app is through the button generated at the /slack/install domain?

I found the below thread, so it seems that it's not supported as the Slack App Directory would work the same as the distribution tab, correct?

#492

TLDR: We decided the oauth library is not going to support the "Add to Slack" button from "Manage Distributions" due to security.

What type of issue is this? (place an x in one of the [ ])

  • bug
  • enhancement (feature request)
  • question
  • documentation related
  • example code related
  • testing related
  • discussion

Requirements (place an x in each of the [ ])

  • I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've searched for any related issues and avoided creating a duplicate issue.

Bug Report

Filling out the following details about bugs will help us solve your issue sooner.

Reproducible in:

package version:

node version:

OS version(s):

Steps to reproduce:

Expected result:

What you expected to happen

Actual result:

What actually happened

Attachments:

Logs, screenshots, screencast, sample project, funny gif, etc.

@gitwave gitwave bot added the untriaged label Jan 7, 2021
@seratch seratch added discussion M-T: An issue where more input is needed to reach a decision enhancement M-T: A feature request for new functionality question M-T: User needs support to use the project and removed untriaged labels Jan 7, 2021
@seratch
Copy link
Member

seratch commented Jan 7, 2021

Hi @MattB543 , thanks for writing in here!

I do understand your point here. Obviously, clicking install button twice is not a great user experience. However, as you guessed, Bolt for JavaScript does not offer out-of-the-box feature to easily redirection from the /slack/install URL without rendering a web page at this point.

Also, unfortunately, the code that generates the /slack/install endpoint is not yet customizable for developers. Thus, a workaround as of today is to implement your own /slack/install endpoint using receiver.router. Refer to this document to know how to add your custom endpoints to Bolt apps.

You can use the custom endpoint for Direct install URL of an App Directory app. To learn how to generate a valid set of parameters, checking this code is helpful. Your app can set a generated URL for "Location" header along with status 302 in response to HTTP requests.

const url = await this.installer!.generateInstallUrl({
  metadata: installerOptions.metadata,
  scopes: scopes!,
  userScopes: installerOptions.userScopes,
});

In Bolt for Python (and also Bolt for Java), we have an option to switch to a Direct Install URL compatible behavior. slackapi/bolt-python#183

Although we may add the similar option to Bolt for JavaScript in the near future, please go with the above workaround for now.

@MattB543
Copy link
Author

MattB543 commented Jan 7, 2021

Thank you, @seratch! Very clear and helpful answer. 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion M-T: An issue where more input is needed to reach a decision enhancement M-T: A feature request for new functionality question M-T: User needs support to use the project
Projects
None yet
Development

No branches or pull requests

2 participants