.env changes are needed.
MagicPost always uses X’s OAuth 2.0 flow for this login. It asks for the users.read, users.email and tweet.read scopes. X must return an email address, otherwise the sign-in is refused.
This is sign-in for your own users. To publish to an X profile you use the credentials under Admin → Publishing → Platforms. See X (Twitter). You can use one X app for both if you register both redirect addresses in it, but each page stores its own copy of the credentials.
Before you start
- You can sign in to the MagicPost admin panel.
- You have an X account with access to the X Developer Console at console.x.com.
- Your site runs on its public
httpsaddress.
Step 1. Copy the Callback URL
1
Open Auth Settings
Go to Admin → Backend Settings → Auth Settings and scroll to the Twitter section.
2
Copy the Callback URL
Copy the value of the read-only Callback URL field. It looks like
https://your-domain.com/auth/twitter/callback. You paste it into X next.Step 2. Create the app in the X Developer Console
1
Create or open an app
Open the X Developer Console and create an app, or open an existing one. Apps are the containers that hold your credentials and settings.
2
Set up OAuth 2.0
In the app’s authentication settings, turn on OAuth 2.0. Choose Web App as the app type. It is a confidential client, which means X gives you a Client Secret.
3
Add the callback address
Add the Callback URL from Step 1 to the app’s callback URLs. X compares it character for character, including any trailing slash, and allows up to 10 callback URLs per app.
4
Allow the email address
Turn on the permission that lets the app request users’ email addresses (Request email from users). Save the settings.
5
Copy the credentials
Open the app’s keys and tokens. Copy the Client ID and the Client Secret from the OAuth 2.0 section.
Step 3. Configure MagicPost
1
Turn on the master switch
On Admin → Backend Settings → Auth Settings, switch on Login via Social (oAuth). It saves as soon as you toggle it.
2
Enable Twitter and fill in the credentials
In the Twitter section, switch on Enable Twitter Login and fill in:
- Twitter API Key: the OAuth 2.0 Client ID.
- Twitter API Secret Key: the OAuth 2.0 Client Secret.
- Twitter Redirect URL: the same address as Callback URL.
3
Save
Click Save. The toast reads Settings were saved successfully.
Test it
- Open your site’s login page in a private browser window.
- Click Twitter under or continue with.
- Authorize the app on X.
- You land on the dashboard. The registration page offers the same button under or sign up with.

