Skip to content

Where to map slack resources to my own org's resources when oauth completes? #1211

@uap-dev

Description

@uap-dev

Description

Hi there. My team is building a new slack app with slack bolt. I was looking for guidance on a particular question. We are currently building out the oauth flow which redirects to our own application after the user accepts the application scopes so that we can authenticate the user in our platform before completing oauth with slack. After authenticating the user in our platform we complete the oauth flow which eventually triggers the installationStore's storeInstallation method per example below:

installationStore: {
    storeInstallation: async (installation) => {
      if (installation.isEnterpriseInstall) {
        // support for org wide app installation
        return await database.set(installation.enterprise.id, installation);
      } else {
        // single team app installation
        return await database.set(installation.team.id, installation);
      }
      throw new Error('Failed saving installation data to installationStore');
    },
    ...
  },

The problem that I am facing is that when I store the installation I also want to be able to link up the relationships between the slack user and the user I know in my own application (i.e. slack user id <> my orgs user id). However, there is nothing that I can pass into this callback from the request that would allow me to do that. What I would like to be able to do is read from the request so I can pull out org specific information that I can use when storing tokens. For example

storeInstallation: async (request, installation)

Would appreciate feedback from this request or perhaps a suggestion on how to best handle this problem.

Thanks!

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementM-T: A feature request for new functionality

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions