This guide explains how to set up Twitter login and rich embeds for your Discourse forum.
Required user level: Administrator
In order for rich embeds to work properly, a Basic plan or higher for X Dev is mandatory. Rich embeds will not work with the Free X Dev plan.
X Configuration
Go to the Developer Portal on X.
Choose between a Free, Basic, or Pro X Dev plan and complete the developer agreement and policy requirements.
After completing the agreement and policy requirements, you’ll be taken to the X dev dashboard.
Create a new project
On your X Dev dashboard, click + Add Project .
Complete the requested information:
Your project name
Use case. If you are using an account with a Basic or Pro plan, please select Embedding_Tweets_in_a_website.
Your project description (e.g., “Enable Twitter login and embeds on a Discourse forum” ).
Select Production for the app environment. Note you may not be prompted to select the app environment.
Your app name
You will be shown your API Key and API Key Secret. Please write these down so you can add them to your Discourse forum later.
Click the App Settings button on the bottom right.
Scroll down to the User Authentication Settings section and click the Set up button. Update the following fields:
App Permission → Read and enable Request_email_from_users
Type of App → Web App, Automated App or Bot
App info →
Callback URL / Redirect URL: https://yourdiscourseforum.com/auth/twitter/callback
Website URL: https://yourdiscourseforum.com
Terms of service: https://yourdiscourseforum.com/tos
Privacy Policy: https://yourdiscourseforum.com/privacy
Click Save .
Discourse configuration
Head over to your Discourse forum and enter the admin panel.
Click the Settings button and choose Login to find the Twitter-related settings:
Enable the enable_twitter_logins setting.
Copy and paste the API Key from X into the twitter_consumer_key setting.
Copy and Paste the API Key Secret from X into the twitter_consumer_secret setting.
Click the green checkmark to save the changes.
Users should now be able to log into your forum using their Twitter Account.
Rich Embeds
The above steps also apply if you want to enable “rich embedding” which allows displaying tweets with their media (images video, etc). If you want rich embeds but don’t need Twitter login, simply uncheck enable twitter logins and leave the consumer key and secret intact.
Rebaking or rebuilding HTML for posts with tweets will re-fetch those tweets, counting against your monthly tweet cap.
Additional resources
Last edited by @sam 2026-03-18T04:43:33Z
Check document Perform check on document:
「いいね!」 75
neil
(Neil Lalonde)
2018 年 6 月 20 日午後 6:23
42
Note that the “Callback URL” field is now mandatory. If you omitted it in your setup, Twitter login will fail with a 403 unauthorized error.
A few weeks ago, we announced several upcoming changes to the developer platform in advance of new European Union data privacy regulations going into effect soon. Today, we’d like to share an additional change for customers using Sign in with...
Reading time: 1 mins 🕑
Likes: 4 ❤
Also note that if you have any extra spaces at the beginning or end of your callback urls, auth will fail. You can find other discussions about this change on the Twitter Community .
「いいね!」 13
Just noticed we were getting the same error on our site with Twitter auth. I noticed Twitter has a new process for authorizing developer apps, so we are going through the approval process. Not sure if it is related, or if this problem has just been in place for a long time now.
「いいね!」 1
I setup my callback URL like this on Twitter, but still getting the same error.
https://www.helloforos.com/auth/twitter
Does this look like the right format? What do you guys use?
I’m going to try it again tomorrow in case there’s some caching issue with Twitter
Anyone else have success with Twitter login?
neil
(Neil Lalonde)
2018 年 9 月 11 日午後 2:15
45
@charleswalter That callback url is wrong. It should be:
「いいね!」 7
that did the trick. Thx for calling that out.
I do recommend that those who haven’t applied on developer.twitter.com for their Twitter app, to do so.
For the near future, you can continue to manage existing apps here on apps.twitter.com . However, we will soon retire this site and consolidate all developer tools, API access, and app management within the developer portal at developer.twitter.com . You will be able to access and manage existing apps through that portal when we retire this site.
「いいね!」 5
dax
(Daniela)
2020 年 3 月 10 日午後 7:08
62
March 2020
Guide completely rewritten because Twitter has changed the whole process … another time
「いいね!」 16
dax
(Daniela)
2020 年 8 月 27 日午前 11:40
70
私の環境では問題なく動作しています
また、https://api.twitterstat.us/ を確認したところ、Developer Portal は正常に動作しています。
おそらく、ソーシャルメディアや追跡機能をブロックする拡張機能などを使用中と思われます。すべての拡張機能を無効にしたシークレットウィンドウでログインしてみてください。
「いいね!」 4
この質問をするのに適切な場所か心配ですが、お尋ねします。
https://try.discourse.org/ を確認すると、Twitter による登録をすると以下のメッセージが表示されます。
このアプリケーションは以下の権限を要求します:
タイムラインのツイート(保護されたツイートを含む)、リスト、コレクションの閲覧。
Twitter プロフィール情報とアカウント設定の閲覧。
フォロー、ミュート、ブロックしているアカウントの閲覧。
メールアドレスの閲覧。
必要な最小限の情報(名前とメールアドレス)のみを許可するように設定することは可能でしょうか?
「いいね!」 1
dax
(Daniela)
2020 年 10 月 20 日午前 11:19
76
これはすでに Twitter が求める最低限の情報です。
ガイドをご覧いただければわかりますが、Discourse がユーザーアカウントを作成するために Twitter に必要な情報はユーザーのメールアドレスのみです。それ以外は、アプリ権限セクションで「読み取り専用」を選択することで Twitter が決定する基本設定です。
「いいね!」 7
こんにちは、ツイートの返信を埋め込もうとしています。
埋め込みは以下のようになります。
返信だけが表示され、元のツイートは表示されません。
これは Discourse の仕様でしょうか、それとも私のやり方に問題があるのでしょうか?
「いいね!」 2
JimPas
2020 年 12 月 14 日午後 7:30
78
Twitter は使っていないのですが、返信リンクは元のツイートとは「別」のものだと推測します。つまり、返信のみがリンクされていることになります。元のツイートにリンクすると、最初の返信も含むのでしょうか、それとも元のツイートのみでしょうか?
「いいね!」 1
こんにちは、Jimpas さん。
いいえ、このアイデアは、リプライを埋め込む際に、画像のように元のツイートをその上に表示できるようにするものです。そうすれば、リプライに文脈が加わります。
スタイリングも気に入っています。
今はリプライの埋め込みだけを行っています。
回避策として、2 つの埋め込みを使用する方法もあります。
「いいね!」 1
JimPas
2020 年 12 月 14 日午後 11:04
80
確かにそれは回避策ですね。しかし、元のツイートを返信の上に配置するにはどうすればよいのでしょうか?つまり、どのように「選択」するのでしょうか?他のウェブサイトでは、元のツイートに最初の返信が添えられている投稿を時折見かけますね。
私も同じ登録の問題に気づきました。テストアカウントを使用しようとすると、Twitterは登録時にメールがアクセスされていると表示しますが、Twitterとの認証ハンドシェイクを完了した後も、メールアカウントはアカウント登録フォームに事前入力されず、事前入力されたユーザー名も「user_1」と表示されます。リッチエンベッドも機能していません。
「いいね!」 1
慌てず、辛抱強くお待ちください。Discourseチームはすべての投稿を注意深く読んでいますので、きっともう対応してくれているはずです。
「いいね!」 2
osioke
(Osioke Itseuwa)
2022 年 1 月 24 日午後 12:30
87
@Hifihedgehog および @dnfoz 様、これは割り当て済みですので、すぐに確認いたします。設定やログインに問題がある方は他にいらっしゃいますか?
「いいね!」 4
f1r4s
(Eddie)
2022 年 1 月 29 日午後 3:16
89
何かアップデートはありますか?私も同じ問題があります。
「いいね!」 1