# Douban Login Plugin / Douban Login Plugin

**URL:** <https://meta.discourse.org/t/douban-login-plugin/19736>\
**Category:** Plugin\
**Tags:** broken\
**Created:** [September 7, 2014, 2:43am UTC](https://meta.discourse.org/t/douban-login-plugin/19736 "2014-09-07T02:43:56Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![fantasticfears](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fantasticfears/32/119608_2.png) [@fantasticfears](https://meta.discourse.org/u/fantasticfears)\
**Post date:** [September 7, 2014, 2:43am UTC](https://meta.discourse.org/t/douban-login-plugin/19736/1 "2014-09-07T02:43:56Z")

</div>

[Douban](http://www.douban.com/) is a Chinese SNS website allowing registered users to record information and create content related to film, books, music, and recent events and activities in Chinese cities.  
Since Douban didn’t provide email, the user have to fill the email address manually.

[https://github.com/fantasticfears/douban-login](https://github.com/fantasticfears/douban-login)

Authenticate with discourse with Douban.

通过豆瓣登陆 Discourse。

## Register Client Key & Secert / 申请豆瓣接入

1. 登录[豆瓣开发者中心](http://developers.douban.com/)，注册填写相关信息。
2. 点击`我的应用`，再点击`创建新应用`。
3. 填写相关信息。`网站域名`可填写根域名或者具体域名。如图所示。（验证所需要的标签可在 Discourse 设置中插入，验证后即可删除；访问 Discourse 管理面板 - 内容 - 页面顶部）  
回调地址：

- https 填写：`http://meta.discoursecn.org:443/auth/douban/callback`
- http 填写：`http://meta.discoursecn.org/auth/douban/callback`

1. 在申请到的后台找到刚申请到的引用，概览中即可以获得`key`和`secret`，将其填入Discourse 设置中。

 ![](https://global.discourse-cdn.com/meta/original/3X/6/8/68594dbc6b9417c3c53528b2082cde4b43cc7988.png)

## Installation / 安装

### Docker 安装

在 `app.yml` 的

```
hooks:
  after_code:
    - exec:
        cd: $home/plugins
        cmd:
          - mkdir -p plugins
          - git clone https://github.com/discourse/docker_manager.git

```

最后一行 `- git clone https://github.com/discourse/docker_manager.git` 后添加：

```
- git clone https://github.com/fantasticfears/douban-login.git

```

### Manual / 手动安装

Run `rake plugin:install repo=https://github.com/fantasticfears/douban-login` in your discourse directory

In development mode, run `rake assets:clean`

In production, recompile your assets: `rake assets:precompile`

在您 Discourse 目录中运行 `rake plugin:install repo=https://github.com/fantasticfears/douban-login`

在开发者模式下，运行 `rake assets:clean`

在生产模式下，重编译 assets `rake assets:precompile`

## Usage / 使用

Go to Site Settings’s login category, fill in the client id and client secret.

进入站点设置的登录分类，填写 client id 和 client serect。

## Issue / 问题

Visit [topic on Discourse Meta](https://meta.discourse.org/t/douban-login-plugin/19736) or [GitHub Issues](https://github.com/fantasticfears/douban-login/issues).

访问[Discourse Meta上的主题](https://meta.discourse.org/t/douban-login-plugin/19736)或[GitHub Issues](https://github.com/fantasticfears/douban-login/issues)。

 ![](https://global.discourse-cdn.com/meta/original/3X/5/d/5d19dcf22c16258324679af1d729a58b7e6a1506.png)

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

 ![](https://global.discourse-cdn.com/meta/original/3X/9/1/9120c8ba6b7f8446ea51f57f9594ecc37712cf64.png)

---

<div class="post-metadata">

**Author:** ![longshun](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/longshun/32/34479_2.png) [@longshun](https://meta.discourse.org/u/longshun)\
**Post date:** [September 25, 2014, 9:47am UTC](https://meta.discourse.org/t/douban-login-plugin/19736/2 "2014-09-25T09:47:21Z")

</div>

做的真棒！

谢谢你的贡献！

正需要呢。  
请问楼主 discourse 的代码在ubuntu的位置中是哪儿呢？

---

<div class="post-metadata">

**Author:** ![fantasticfears](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fantasticfears/32/119608_2.png) [@fantasticfears](https://meta.discourse.org/u/fantasticfears)\
**Post date:** [September 25, 2014, 10:58am UTC](https://meta.discourse.org/t/douban-login-plugin/19736/3 "2014-09-25T10:58:26Z")

</div>

你应该把那一段加到 `containers/app.yml` 里面。

---

<div class="post-metadata">

**Author:** ![longshun](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/longshun/32/34479_2.png) [@longshun](https://meta.discourse.org/u/longshun)\
**Post date:** [September 25, 2014, 11:37am UTC](https://meta.discourse.org/t/douban-login-plugin/19736/4 "2014-09-25T11:37:50Z")

</div>

好的，谢谢楼主！  
—  
Sent from [Mailbox](https://www.dropbox.com/mailbox)

---

<div class="post-metadata">

**Author:** ![zgd136](https://avatars.discourse-cdn.com/v4/letter/z/46a35a/32.png) [@zgd136](https://meta.discourse.org/u/zgd136)\
**Post date:** [October 5, 2014, 2:48am UTC](https://meta.discourse.org/t/douban-login-plugin/19736/5 "2014-10-05T02:48:54Z")

</div>

```
  rm: cannot remove ‘/var/www/discourse/public/plugins/emoji’: Operation not permitted
ln: failed to create symbolic link ‘/var/www/discourse/public/plugins/emoji/public’: File exists
Cloning into '/var/www/discourse/plugins/douban-login'...
remote: Counting objects: 27, done.
remote: Total 27 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (27/27), done.
Checking connectivity... done.
warning: unable to access '/root/.config/git/attributes': Permission denied

```

try to install, but error shown above.

---

<div class="post-metadata">

**Author:** ![zgd136](https://avatars.discourse-cdn.com/v4/letter/z/46a35a/32.png) [@zgd136](https://meta.discourse.org/u/zgd136)\
**Post date:** [November 10, 2014, 4:10am UTC](https://meta.discourse.org/t/douban-login-plugin/19736/29 "2014-11-10T04:10:25Z")

</div>

This plugin does not working with newer Discourse.

---

<div class="post-metadata">

**Author:** ![fantasticfears](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fantasticfears/32/119608_2.png) [@fantasticfears](https://meta.discourse.org/u/fantasticfears)\
**Post date:** [November 10, 2014, 4:54am UTC](https://meta.discourse.org/t/douban-login-plugin/19736/30 "2014-11-10T04:54:59Z")

</div>

Works fine in 1.2.0.beta1. Would you mind posting your version?

---

<div class="post-metadata">

**Author:** ![zgd136](https://avatars.discourse-cdn.com/v4/letter/z/46a35a/32.png) [@zgd136](https://meta.discourse.org/u/zgd136)\
**Post date:** [November 22, 2014, 12:08am UTC](https://meta.discourse.org/t/douban-login-plugin/19736/31 "2014-11-22T00:08:03Z")

</div>

Sorry for late reply,  
My version is : 1.2.0.beta2  
tried reinstall plugin.

---

<div class="post-metadata">

**Author:** ![fantasticfears](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fantasticfears/32/119608_2.png) [@fantasticfears](https://meta.discourse.org/u/fantasticfears)\
**Post date:** [November 22, 2014, 5:29am UTC](https://meta.discourse.org/t/douban-login-plugin/19736/32 "2014-11-22T05:29:21Z")

</div>

Can you see the settings in the `Login` tab? Can you see the login option in the `Create New Account`?

Are you sure you added the `git clone`… into your configuration file?

---

<div class="post-metadata">

**Author:** ![zgd136](https://avatars.discourse-cdn.com/v4/letter/z/46a35a/32.png) [@zgd136](https://meta.discourse.org/u/zgd136)\
**Post date:** [November 26, 2014, 2:43am UTC](https://meta.discourse.org/t/douban-login-plugin/19736/33 "2014-11-26T02:43:35Z")

</div>

Thank you for update,  
I finally figured it out myself.

i accidentally created duplicate folder

---

<div class="post-metadata">

**Author:** ![preDawnHunter](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/predawnhunter/32/116445_2.png) [@preDawnHunter](https://meta.discourse.org/u/preDawnHunter)\
**Post date:** [July 21, 2015, 5:08pm UTC](https://meta.discourse.org/t/douban-login-plugin/19736/34 "2015-07-21T17:08:24Z")

</div>

我的网站在登录豆瓣之后就转到个页面只显示下面的code

```
{"msg":"not_trial_user: 69207986","code":110,"request":"POST \/auth2\/auth"}

```

我的设置都没有问题的应该，回调地址用的 /auth/douban/callback。只是api还没审核，which我不知道该选哪个，豆瓣公共就够了？

Thanks.

---

<div class="post-metadata">

**Author:** ![fantasticfears](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fantasticfears/32/119608_2.png) [@fantasticfears](https://meta.discourse.org/u/fantasticfears)\
**Post date:** [July 22, 2015, 4:06am UTC](https://meta.discourse.org/t/douban-login-plugin/19736/35 "2015-07-22T04:06:59Z")

</div>

豆瓣公共足够了。如果是测试状态，你应该在豆瓣那增加测试用户。审核后似乎是正常的？见 [https://meta.discoursecn.org](https://meta.discoursecn.org) 的登录

---

<div class="post-metadata">

**Author:** ![talkingabout.org](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/talkingabout.org/32/162899_2.png) [@talkingabout.org](https://meta.discourse.org/u/talkingabout.org)\
**Post date:** [December 4, 2019, 5:05am UTC](https://meta.discourse.org/t/douban-login-plugin/19736/36 "2019-12-04T05:05:08Z")

</div>

Not bad, not bad, but this system is used far too little domestically and hasn’t gained popularity. It’s also possible that there are simply fewer websites being built nowadays. The lack of popularity isn’t due to forum software itself; even Discuz is seeing fewer users for site building. In the past, when regulations were less strict, forums were everywhere, and anyone could set one up by simply renting a host.

---

<div class="post-metadata">

**Author:** ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)\
**Post date:** [June 18, 2024, 3:44pm UTC](https://meta.discourse.org/t/douban-login-plugin/19736/37 "2024-06-18T15:44:08Z")

</div>


