# How to login to discourse from external website

**URL:** https://meta.discourse.org/t/how-to-login-to-discourse-from-external-website/54633
**Category:** SSO
**Created:** [2016 年 12 月 22 日午前 3:01 UTC](https://meta.discourse.org/t/how-to-login-to-discourse-from-external-website/54633 "2016-12-22T03:01:37Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![mkdlin](https://avatars.discourse-cdn.com/v4/letter/m/49beb7/32.png) [@mkdlin](https://meta.discourse.org/u/mkdlin)
#### Post date: [2016 年 12 月 22 日午前 3:01 UTC](https://meta.discourse.org/t/how-to-login-to-discourse-from-external-website/54633/1 "2016-12-22T03:01:37Z")

</div>

I’ve been trying to search through the support forums on how to allow users to login to discourse from my website  
I came across SSO but I don’t think that’s exactly what I’m looking for (?)

Basically what I would like to do is to have a php form on my website where users can enter their username/password, and then this form will be submitted to the discourse site so when users press login they will automatically enter discourse without first having to see a discourse standalone login page.

How would I do this? Or any alternatives?

---

<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: [2016 年 12 月 22 日午前 3:15 UTC](https://meta.discourse.org/t/how-to-login-to-discourse-from-external-website/54633/2 "2016-12-22T03:15:37Z")

</div>

That is SSO, so you had the right idea.

---

<div class="post-metadata">

### Author: ![mkdlin](https://avatars.discourse-cdn.com/v4/letter/m/49beb7/32.png) [@mkdlin](https://meta.discourse.org/u/mkdlin)
#### Post date: [2016 年 12 月 22 日午前 3:39 UTC](https://meta.discourse.org/t/how-to-login-to-discourse-from-external-website/54633/3 "2016-12-22T03:39:01Z")

</div>

I would still like to use discourse authentication (no separate login/authentication database on my own website), just that the login button/field of discourse is embedded in my website. In this case (embedding discourse login in another website), would that still fall under SSO?

As I’m reading through the official [discourse SSO](https://meta.discourse.org/t/13045?silent=true) documentation, it mentions that if SSO is to replace the original discourse authentication.

---

<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: [2016 年 12 月 22 日午前 3:42 UTC](https://meta.discourse.org/t/how-to-login-to-discourse-from-external-website/54633/4 "2016-12-22T03:42:54Z")

</div>

Then you want oAuth 2

---

<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: [2019 年 4 月 11 日午後 12:39 UTC](https://meta.discourse.org/t/how-to-login-to-discourse-from-external-website/54633/5 "2019-04-11T12:39:22Z")

</div>



---

<div class="post-metadata">

### Author: ![dax](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dax/32/244677_2.png) [@dax](https://meta.discourse.org/u/dax)
#### Post date: [2019 年 4 月 11 日午後 12:43 UTC](https://meta.discourse.org/t/how-to-login-to-discourse-from-external-website/54633/6 "2019-04-11T12:43:24Z")

</div>

For reference

> [@Discourse OAuth2 Basic](https://meta.discourse.org/t/oauth2-basic-support/33879):
>
> discourse2Summary Discourse OAuth2 Basic supports basic OAuth2 providers, assuming they have a JSON API endpoint where user details can be retrieved by token.open_bookInstall Guide This plugin is bundled with Discourse core. There is no need to install the plugin separately. Features This plugin allows you to use a basic OAuth2 provider as authentication for Discourse. It should work with many providers, with the caveat that they must provide a JSON endpoint for retri…

---

<div class="post-metadata">

### Author: ![dax](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dax/32/244677_2.png) [@dax](https://meta.discourse.org/u/dax)
#### Post date: [2019 年 4 月 11 日午後 12:43 UTC](https://meta.discourse.org/t/how-to-login-to-discourse-from-external-website/54633/7 "2019-04-11T12:43:30Z")

</div>


