# Can I require a Discourse login to view things on a different site?

**URL:** https://meta.discourse.org/t/can-i-require-a-discourse-login-to-view-things-on-a-different-site/42430
**Category:** Support
**Created:** [4월 12, 2016, 7:07오전 UTC](https://meta.discourse.org/t/can-i-require-a-discourse-login-to-view-things-on-a-different-site/42430 "2016-04-12T07:07:00Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Teeigeryuh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/teeigeryuh/32/55526_2.png) [@Teeigeryuh](https://meta.discourse.org/u/Teeigeryuh)
#### Post date: [4월 12, 2016, 7:07오전 UTC](https://meta.discourse.org/t/can-i-require-a-discourse-login-to-view-things-on-a-different-site/42430/1 "2016-04-12T07:07:00Z")

</div>

Imagine i have ths

`site.com/stuff`  
`discourse.site.com`

How can i make it so in orfder for someone to view the content inside “/stuff” be logged in?

---

<div class="post-metadata">

### Author: ![DeanMarkTaylor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/deanmarktaylor/32/102462_2.png) [@DeanMarkTaylor](https://meta.discourse.org/u/DeanMarkTaylor)
#### Post date: [4월 12, 2016, 4:09오후 UTC](https://meta.discourse.org/t/can-i-require-a-discourse-login-to-view-things-on-a-different-site/42430/2 "2016-04-12T16:09:35Z")

</div>

There are two types of [Discourse SSO](https://meta.discourse.org/t/13045?silent=true) (Single Sign On), you want the one where Discourse is the provider:

> [@Use Discourse as an identity provider (SSO, DiscourseConnect)](https://meta.discourse.org/t/using-discourse-as-a-sso-provider/32974):
>
> So you want to use Discourse as an identity provider for your own web app? Great! Let’s get started. Enable [DiscourseConnect](https://meta.discourse.org/t/13045?silent=true) provider setting Under Discourse admin site settings (/admin/site\_settings) enable setting enable discourse connect provider and add a secret string to discourse connect provider secrets (used to hash SSO payloads). Implement [DiscourseConnect](https://meta.discourse.org/t/13045?silent=true) in your web app: Generate a random [nonce](https://en.wikipedia.org/wiki/Cryptographic_nonce). Let’s call this value NONCE. Save it temporarily so that you can verify it with the …

---

<div class="post-metadata">

### Author: ![Tom\_Newsom](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tom_newsom/32/115981_2.png) [@Tom\_Newsom](https://meta.discourse.org/u/Tom_Newsom)
#### Post date: [4월 13, 2016, 8:38오전 UTC](https://meta.discourse.org/t/can-i-require-a-discourse-login-to-view-things-on-a-different-site/42430/3 "2016-04-13T08:38:53Z")

</div>

Does this also work when users authenticate using a third party eg google or facebook?

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [1월 5, 2019, 11:44오후 UTC](https://meta.discourse.org/t/can-i-require-a-discourse-login-to-view-things-on-a-different-site/42430/4 "2019-01-05T23:44:06Z")

</div>



---

<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: [1월 6, 2019, 11:42오후 UTC](https://meta.discourse.org/t/can-i-require-a-discourse-login-to-view-things-on-a-different-site/42430/5 "2019-01-06T23:42:09Z")

</div>

See also

[https://github.com/discourse/discourse-auth-proxy](https://github.com/discourse/discourse-auth-proxy)

We use it extensively and allows very seamless integration even with sites that do not implement auth properly.

Other option is SSO as @DeanMarkTaylor pointed out. (technically auth proxy uses SSO its just much easier to configure in certain cases)

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [2월 5, 2019, 11:42오후 UTC](https://meta.discourse.org/t/can-i-require-a-discourse-login-to-view-things-on-a-different-site/42430/6 "2019-02-05T23:42:10Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
