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

Add a way to turn off web page rendering for "/slack/install" #977

Closed
4 of 10 tasks
seratch opened this issue Jun 29, 2021 · 0 comments · Fixed by #1079
Closed
4 of 10 tasks

Add a way to turn off web page rendering for "/slack/install" #977

seratch opened this issue Jun 29, 2021 · 0 comments · Fixed by #1079
Assignees
Labels
enhancement M-T: A feature request for new functionality semver:minor
Milestone

Comments

@seratch
Copy link
Member

seratch commented Jun 29, 2021

Description

As described at #732 , there is no way to directly redirect installers to the authorize url with the out-of-the-box receivers. Also, the code that generates the /slack/install endpoint is not yet customizable for developers.

Workaround

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,
});

Solution

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

We can add a similar option to change the behavior. If the page rendering is disabled (default: enabled), Bolt redirects installers to generated authorize URL.

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.
@seratch seratch added enhancement M-T: A feature request for new functionality semver:minor labels Jun 29, 2021
@seratch seratch added this to the 3.5.0 milestone Jun 29, 2021
@seratch seratch modified the milestones: 3.5.0, 3.6.0 Jul 14, 2021
@srajiang srajiang modified the milestones: 3.6.0, 3.7.0 Aug 19, 2021
seratch added a commit to seratch/bolt-js that referenced this issue Aug 24, 2021
seratch added a commit to seratch/bolt-js that referenced this issue Aug 25, 2021
seratch added a commit that referenced this issue Aug 25, 2021
#1079)

* Fix #977 Add a way to turn off web page rendering for "/slack/install"

* Remove package-lock.json from the example app

* Apply suggestions from code review

Co-authored-by: Fil Maj <maj.fil@gmail.com>

* Add bolt to dependencies

* Comment out the new flag in the example app

* Rename directInstallUrlEnabled to directInstall

* Apply suggestions from code review

Co-authored-by: Sarah Jiang <srajiang@gmail.com>

Co-authored-by: Fil Maj <maj.fil@gmail.com>
Co-authored-by: Sarah Jiang <srajiang@gmail.com>
@seratch seratch self-assigned this Aug 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement M-T: A feature request for new functionality semver:minor
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants