X-Login und Rich Embeds für Discourse konfigurieren

:bookmark: This guide explains how to set up Twitter login and rich embeds for your Discourse forum.

:person_raising_hand: Required user level: Administrator

:warning: 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

  1. Go to the Developer Portal on X.

  2. Choose between a Free, Basic, or Pro X Dev plan and complete the developer agreement and policy requirements.

  3. After completing the agreement and policy requirements, you’ll be taken to the X dev dashboard.

Create a new project

  1. On your X Dev dashboard, click + Add Project.

  2. 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
  3. 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.

  4. Click the App Settings button on the bottom right.

  5. 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

  6. Click Save.

Discourse configuration

  1. Head over to your Discourse forum and enter the admin panel.

  2. Click the Settings button and choose Login to find the Twitter-related settings:

  3. Enable the enable_twitter_logins setting.

  4. Copy and paste the API Key from X into the twitter_consumer_key setting.

  5. Copy and Paste the API Key Secret from X into the twitter_consumer_secret setting.

  6. 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.

:warning: 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 documentPerform check on document:
75 „Gefällt mir“

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.

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 „Gefällt mir“

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 „Gefällt mir“

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?

@charleswalter That callback url is wrong. It should be:

7 „Gefällt mir“

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 „Gefällt mir“

March 2020

Guide completely rewritten because Twitter has changed the whole process … another time :sweat_smile:

16 „Gefällt mir“

Twitter scheint nicht zu funktionieren

„App erstellen

1 „Gefällt mir“

Bei mir funktioniert es.

Und wenn man sich https://api.twitterstat.us/ ansieht, ist das Developer-Portal in Ordnung.

Du verwendest wahrscheinlich eine Erweiterung, die Social Media, Tracking oder Ähnliches blockiert. Versuche, dich in einem anonymen Fenster einzuloggen, in dem alle Erweiterungen deaktiviert sind.

4 „Gefällt mir“

Der Leitfaden wurde aktualisiert

7 „Gefällt mir“

Ich hoffe, dies ist der richtige Ort, um diese Frage zu stellen. Laut https://try.discourse.org/ führt die Registrierung über Twitter zu folgender Meldung:

Diese Anwendung wird in der Lage sein:

Tweets aus deiner Zeitleiste (einschließlich geschützter Tweets) sowie deine Listen und Sammlungen einzusehen.
Deine Twitter-Profilinformationen und Kontoeinstellungen einzusehen.
Konten einzusehen, denen du folgst, die du stummschaltest oder blockierst.
Deine E-Mail-Adresse einzusehen.

Ist es möglich, die Einrichtung so zu gestalten, dass nur das unbedingt notwendige Minimum an Informationen abgerufen wird – also Name und E-Mail-Adresse, wie ich vermute?

1 „Gefällt mir“

Dies ist bereits die Mindestinformation, die Twitter verlangt.

Wie Sie der Anleitung entnehmen können, benötigen wir von Twitter nur die E-Mail-Adresse des Benutzers, damit Discourse das Benutzerkonto erstellen kann. Alles andere sind die Grundeinstellungen, die Twitter festlegt, indem im Abschnitt „App-Berechtigungen“ die Option „Nur lesen“ ausgewählt wird.

7 „Gefällt mir“

Hallo, ich versuche, eine Antwort auf einen Tweet einzubetten.

Die Einbettung sollte so aussehen:

Ich bekomme nur die Antwort angezeigt, nicht aber den ursprünglichen Tweet. Ist das so gewollt in Discourse, oder mache ich etwas falsch?

2 „Gefällt mir“

Ich nutze Twitter nicht, aber ich nehme an, dass der Antwort-Link anders ist als der Link zum ursprünglichen Tweet. Verlinkst du also nur die Antwort? Beinhaltet das Verlinken zum ursprünglichen Tweet auch die erste Antwort oder nur den ursprünglichen Tweet?

1 „Gefällt mir“

Hi Jimpas,

Nein, die Idee ist, dass du bei der Einbettung der Antwort entscheiden kannst, ob der ursprüngliche Tweet darüber angezeigt werden soll, wie auf dem Bild zu sehen. So hat die Antwort einen Kontext.
Das Styling gefällt mir auch ziemlich gut.

Ich bekomme nur die Antwort angezeigt.
Eine Workaround-Lösung sind zwei Einbettungen.

1 „Gefällt mir“

Das ist tatsächlich eine Umgehungslösung. Aber wie kann man entscheiden, dass der ursprüngliche Tweet über einer Antwort steht? Wie könnte man also etwas „wählen“? Ich sehe manchmal, dass jemand auf einer anderen Website postet, dass der ursprüngliche Tweet die erste Antwort darauf enthält. :thinking:

Ich bemerke dasselbe Registrierungsproblem. Wenn ich ein Testkonto verwende und Twitter bei der Registrierung angibt, dass auf die E-Mail zugegriffen wird, wird das E-Mail-Konto nach Abschluss des Authentifizierungshandshakes mit Twitter nicht in das Formular zur Kontoerstellung vorausgefüllt, und es wird auch „user_1“ für den vorausgefüllten Benutzernamen angezeigt. Rich Embeds funktionieren ebenfalls nicht.

1 „Gefällt mir“

Keine Panik und warten Sie geduldig. Das Discourse-Team liest jeden Beitrag sehr sorgfältig, daher bin ich sicher, dass sie sich bereits darum kümmern. :slight_smile:

2 „Gefällt mir“

@Hifihedgehog und @dnfoz wurde dies zugewiesen, wir werden es in Kürze prüfen. Haben noch andere Probleme bei der Einrichtung und Anmeldung?

4 „Gefällt mir“

Irgendwelche Neuigkeiten?? Ich habe dasselbe Problem

1 „Gefällt mir“