# When site is login required you can not onebox any local topics

**URL:** https://meta.discourse.org/t/when-site-is-login-required-you-can-not-onebox-any-local-topics/46797
**Category:** Bug
**Created:** [Julho 4, 2016, 9:00am UTC](https://meta.discourse.org/t/when-site-is-login-required-you-can-not-onebox-any-local-topics/46797 "2016-07-04T09:00:50Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![thorbenegberts](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thorbenegberts/32/120119_2.png) [@thorbenegberts](https://meta.discourse.org/u/thorbenegberts)
#### Post date: [Julho 4, 2016, 9:00am UTC](https://meta.discourse.org/t/when-site-is-login-required-you-can-not-onebox-any-local-topics/46797/1 "2016-07-04T09:00:50Z")

</div>

Hi there,

I’m experiencing issues with OneBox links. If I open a topic, I get an error code 404. The boxes worked before. Any idea why this is?

Here’s the error message:

 ![](https://global.discourse-cdn.com/meta/original/3X/2/c/2cbd730a396664011f22951fe9e59814f6ea451a.png)

Here are my settings:

 ![](https://global.discourse-cdn.com/meta/original/3X/c/e/ce94fc3edf1f9802857779b4f44609c5ef46097f.png)

Reproducible on our hosted instance **[forum.plentymarkets.com](http://forum.plentymarkets.com)**

Tell me if you need more information. Thanks!

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [Julho 4, 2016, 9:20am UTC](https://meta.discourse.org/t/when-site-is-login-required-you-can-not-onebox-any-local-topics/46797/2 "2016-07-04T09:20:54Z")

</div>

@zogstrip can you have a look? we recently changed the way urls are translated, maybe it is related?

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [Julho 4, 2016, 8:38pm UTC](https://meta.discourse.org/t/when-site-is-login-required-you-can-not-onebox-any-local-topics/46797/3 "2016-07-04T20:38:49Z")

</div>

I’m pretty sure that oneboxing never worked when `login_required` is enabled. Since the oneboxer makes anonymous HTTP requests, it can only see what’s visible to anonymous users.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [Julho 5, 2016, 12:19am UTC](https://meta.discourse.org/t/when-site-is-login-required-you-can-not-onebox-any-local-topics/46797/4 "2016-07-05T00:19:29Z")

</div>

I am going to recategorize this as a bug though.

The oneboxer should be doing reqs as a logged in user, it hurts us on dev as well, we can not onebox anything local.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [Julho 5, 2016, 3:13am UTC](https://meta.discourse.org/t/when-site-is-login-required-you-can-not-onebox-any-local-topics/46797/5 "2016-07-05T03:13:31Z")

</div>

Sorry, I’m not following. Local onebox works fine on login required forums.

Is the topic in a private category?

---

<div class="post-metadata">

### Author: ![watchmanmonitor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/watchmanmonitor/32/430970_2.png) [@watchmanmonitor](https://meta.discourse.org/u/watchmanmonitor)
#### Post date: [Julho 5, 2016, 3:22am UTC](https://meta.discourse.org/t/when-site-is-login-required-you-can-not-onebox-any-local-topics/46797/6 "2016-07-05T03:22:26Z")

</div>

I wonder about cross-category oneboxing. If a User A posts in category A with a onebox from category B, but doesn’t have access to category b, will the information be shown?

If User A has access to both categories, but user B, who is in category A, doesn’t have access to category B, a successful onebox might share too much information.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [Julho 5, 2016, 4:33am UTC](https://meta.discourse.org/t/when-site-is-login-required-you-can-not-onebox-any-local-topics/46797/7 "2016-07-05T04:33:30Z")

</div>

Not sure about that are you sure you are not confusing onebox with quoting?

---

<div class="post-metadata">

### Author: ![thorbenegberts](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thorbenegberts/32/120119_2.png) [@thorbenegberts](https://meta.discourse.org/u/thorbenegberts)
#### Post date: [Julho 5, 2016, 7:18am UTC](https://meta.discourse.org/t/when-site-is-login-required-you-can-not-onebox-any-local-topics/46797/8 "2016-07-05T07:18:55Z")

</div>

> [@Falco](#):
>
> Sorry, I’m not following. Local onebox works fine on login required forums.
> 
> Is the topic in a private category?

So far as I recall oneboxing worked fine in our login required forum. It was/is a heavy used feature. And it’s not a private category.

> [@watchmanmonitor](#):
>
> I wonder about cross-category oneboxing. If a User A posts in category A with a onebox from category B, but doesn’t have access to category b, will the information be shown?

We also oneboxed links to private categories. Users without permission didn’t see the box, just the link. If they click the link, they get an “error message”. That’s fine.

If I have the time today I will checkout and test some previous versions of Discourse locally.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [Julho 5, 2016, 1:27pm UTC](https://meta.discourse.org/t/when-site-is-login-required-you-can-not-onebox-any-local-topics/46797/9 "2016-07-05T13:27:23Z")

</div>

Pretty sure I’m sure that is onebox for sure 😆 (sorry)

I even sent a PR to fix this on subfolder installs! It uses the local onebox engine, to bypass login. It’s inside the discourse project, not the onebox project.

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [Novembro 3, 2016, 9:52pm UTC](https://meta.discourse.org/t/when-site-is-login-required-you-can-not-onebox-any-local-topics/46797/10 "2016-11-03T21:52:08Z")

</div>

@Falco was right. It worked for quite a while 😉

The only time it **doesn’t** work is when the topic is in a **private** category.

I cleaned up and optimised the code too 🍓

[https://github.com/discourse/discourse/commit/a655e4b09259fa5a908416b0add303d7c710ac1f](https://github.com/discourse/discourse/commit/a655e4b09259fa5a908416b0add303d7c710ac1f)

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [Novembro 4, 2016, 10:00pm UTC](https://meta.discourse.org/t/when-site-is-login-required-you-can-not-onebox-any-local-topics/46797/11 "2016-11-04T22:00:50Z")

</div>

This topic was automatically closed after 24 hours. New replies are no longer allowed.
