# Allow Slack to unfurl/expand links to "login-required" Discourse instance

**URL:** https://meta.discourse.org/t/allow-slack-to-unfurl-expand-links-to-login-required-discourse-instance/39547
**Category:** Feature
**Created:** [February 14, 2016, 3:02am UTC](https://meta.discourse.org/t/allow-slack-to-unfurl-expand-links-to-login-required-discourse-instance/39547 "2016-02-14T03:02:41Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![mcwumbly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcwumbly/32/103861_2.png) [@mcwumbly](https://meta.discourse.org/u/mcwumbly)
#### Post date: [February 14, 2016, 3:02am UTC](https://meta.discourse.org/t/allow-slack-to-unfurl-expand-links-to-login-required-discourse-instance/39547/1 "2016-02-14T03:02:41Z")

</div>

I reached out to the Slack folks with this request and got the following reply.

My request:

> We have private Slack and Discourse instances and I’m looking for ways to better integrate the two. We also use Google Apps extensively.

> It’d be awesome if there were a way to configure Slack with credentials to retrieve content from these other applications and unfurl/expand them accordingly.

> I searched and haven’t found any way to do this yet. Is it already possible? If not, is this a request that could be considered in the future?

> Thanks!

Their reply:

> Thanks for taking the time to write in! A better standard for custom unfurling of private content is something we’re indeed looking to offer further down the road.

> For now, we’d recommend you start by creating a Slack app, since we already have features that will get you close to what you’re looking for:

> [Slack developer docs | Slack Developer Docs](https://api.slack.com/slack-apps)

> OAuth would allow teams who’ve added your app to send an authenticated request from Slack to your service (triggered by the posting of your private links).

> You can use a outgoing webhook or bot to listen for these links, retrieve the relevant content, then send it back in a payload to the team as a workaround to offer this content.

> I hope this suggestion helps you get started, and please let us know if there’s anything else we can help with!

> Regards,  
> Tuan

---

<div class="post-metadata">

### Author: ![mcwumbly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcwumbly/32/103861_2.png) [@mcwumbly](https://meta.discourse.org/u/mcwumbly)
#### Post date: [May 7, 2016, 3:05pm UTC](https://meta.discourse.org/t/allow-slack-to-unfurl-expand-links-to-login-required-discourse-instance/39547/2 "2016-05-07T15:05:00Z")

</div>

I’m going to investigate working on this because I think it would add a ton of value to our private instance.

Here’s what I’m thinking:

1. **In Slack** Configure an [outgoing web hook](https://api.slack.com/outgoing-webhooks) in slack
  - `trigger_word=myforum.domain.com`
  - `token=someToken`
  - `URLs=https://myforum.com/slackdoor/`
  - `text=the original chat message body that includes myforum.domain.com in there`

2. **In Discourse** Add `/slackdoor` endpoint to Discourse
  - `site_setting:slackdoor_token=someToken`
  - `check that requestbody.token=site_setting.slackdoor_token`
  - `parse requestbody.text field for URL`
  - retrieve post data from the post associated with the URL
  - respond with a rich body compatible with slacks [message attachment api](https://api.slack.com/docs/attachments)

Is part (2) of this plugin territory? Or something that belongs in core? (Or has anyone done something like this already that I haven’t seen yet).

---

<div class="post-metadata">

### Author: ![mcwumbly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcwumbly/32/103861_2.png) [@mcwumbly](https://meta.discourse.org/u/mcwumbly)
#### Post date: [May 11, 2016, 2:27pm UTC](https://meta.discourse.org/t/allow-slack-to-unfurl-expand-links-to-login-required-discourse-instance/39547/3 "2016-05-11T14:27:48Z")

</div>

I’ve got a basic implementation of this working along the line of what I posted above…

I will post a proper plugin topic and readme in the next day or so.

If anyone has any feedback in the mean time, please let me know:

[https://github.com/mcwumbly/discourse-slackdoor](https://github.com/mcwumbly/discourse-slackdoor)

---

<div class="post-metadata">

### Author: ![erlend\_sh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/erlend_sh/32/119475_2.png) [@erlend\_sh](https://meta.discourse.org/u/erlend_sh)
#### Post date: [May 11, 2016, 4:30pm UTC](https://meta.discourse.org/t/allow-slack-to-unfurl-expand-links-to-login-required-discourse-instance/39547/4 "2016-05-11T16:30:40Z")

</div>

Would it make sense to bake this into the [Slack Notification](https://meta.discourse.org/t/slack-notification-plugin/32200) plugin by @bernd?

---

<div class="post-metadata">

### Author: ![mcwumbly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcwumbly/32/103861_2.png) [@mcwumbly](https://meta.discourse.org/u/mcwumbly)
#### Post date: [May 11, 2016, 10:54pm UTC](https://meta.discourse.org/t/allow-slack-to-unfurl-expand-links-to-login-required-discourse-instance/39547/5 "2016-05-11T22:54:39Z")

</div>

Maybe, I’m not sure yet. At the moment, I need this feature and not what that other plugin has to offer. I imagine the reverse may be true too.

@sam if you have a few minutes to take a look at the direction this one is headed, I’d love a sanity check on how some of the authentication stuff is being overridden…

---

<div class="post-metadata">

### Author: ![mcwumbly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcwumbly/32/103861_2.png) [@mcwumbly](https://meta.discourse.org/u/mcwumbly)
#### Post date: [May 22, 2016, 8:34pm UTC](https://meta.discourse.org/t/allow-slack-to-unfurl-expand-links-to-login-required-discourse-instance/39547/6 "2016-05-22T20:34:10Z")

</div>

> [@mcwumbly](#):
>
> I will post a proper plugin topic and readme in the next day or so.

The canonical plugin topic is now here: [Discourse Slackdoor Plugin](https://meta.discourse.org/t/discourse-slackdoor-plugin/44632)

---

<div class="post-metadata">

### Author: ![erlend\_sh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/erlend_sh/32/119475_2.png) [@erlend\_sh](https://meta.discourse.org/u/erlend_sh)
#### Post date: [May 22, 2016, 9:39pm UTC](https://meta.discourse.org/t/allow-slack-to-unfurl-expand-links-to-login-required-discourse-instance/39547/7 "2016-05-22T21:39:07Z")

</div>


