|
| 1 | +--- |
| 2 | +layout: integration |
| 3 | +title: OAuth with X |
| 4 | +description: Authenticate users with an existing X account |
| 5 | +date: 2026-04-09 |
| 6 | +featured: false |
| 7 | +isPartner: true |
| 8 | +isNew: true |
| 9 | +cover: /images/integrations/oauth-x/cover.png |
| 10 | +category: auth |
| 11 | +product: |
| 12 | + avatar: '/images/integrations/avatars/x.png' |
| 13 | + vendor: X |
| 14 | + description: 'X (formerly Twitter) is a social media platform where users can post short messages, follow others, and engage in real-time conversations on topics ranging from news and politics to entertainment and technology.' |
| 15 | +platform: |
| 16 | + - 'Cloud' |
| 17 | +images: |
| 18 | + - /images/integrations/oauth-x/cover.png |
| 19 | + - /images/integrations/oauth-x/new-app.png |
| 20 | + - /images/integrations/oauth-x/oauth2.png |
| 21 | + - /images/integrations/oauth-x/provider.png |
| 22 | +--- |
| 23 | + |
| 24 | +X, formerly known as Twitter, is a social media platform where users can post short messages, follow others, and engage in real-time conversations on topics ranging from news and politics to entertainment and technology. With hundreds of millions of active users worldwide, X is one of the most widely used social platforms and provides OAuth 2.0 support, allowing developers to authenticate users through their existing X accounts. |
| 25 | + |
| 26 | +# How does the integration work? |
| 27 | + |
| 28 | +You can use the X OAuth adapter in Appwrite Auth for user authentication and management. This can be convenient for users because they can start using your app without creating a new account. It can also be more secure, because the user has one less password that could become vulnerable. |
| 29 | + |
| 30 | +# How to implement |
| 31 | + |
| 32 | +To implement the X OAuth adapter in Appwrite Auth, there are several steps you must complete: |
| 33 | + |
| 34 | +## Step 1: Create an X Developer app |
| 35 | + |
| 36 | +First, head to the [X Developer Portal](https://console.x.com/) and create a new project. Head to the **Apps** |
| 37 | + |
| 38 | + |
| 39 | + |
| 40 | +In your app's settings, scroll down to **User authentication settings** and click **Set up**. Configure the following: |
| 41 | + |
| 42 | +- **App permissions**: Select **Read** at minimum. |
| 43 | +- **Type of App**: Select **Web App, Automated App or Bot**. |
| 44 | +- **Callback URI / Redirect URL**: Temporarily add `https://temporary-endpoint.com/`. This will be replaced with the actual URI once the OAuth2 adapter is configured on Appwrite. |
| 45 | + |
| 46 | + |
| 47 | + |
| 48 | +After saving, X will display a **Client ID** and **Client Secret**. Save both values for later use. |
| 49 | + |
| 50 | +## Step 2: Add X OAuth adapter to your Appwrite project |
| 51 | + |
| 52 | +For this step, you must [create an account on Appwrite Cloud](https://cloud.appwrite.io/register) if you haven't already. In your Appwrite project, head over to the **Auth** page, open the **Settings** tab, and click on **X** under the **OAuth2 Providers** section. |
| 53 | + |
| 54 | + |
| 55 | + |
| 56 | +Add the **Client ID** and **Client Secret** you saved from your X app and copy the URI to replace the temporary URL in the **Callback URI / Redirect URL** field in your X app's user authentication settings. |
| 57 | + |
| 58 | +## Step 3: Test the provider. |
| 59 | + |
| 60 | +Follow the [OAuth 2 login](/docs/products/auth/oauth2#init) flow to test your provider. |
| 61 | + |
| 62 | +# Read more about X and Appwrite Auth |
| 63 | + |
| 64 | +If you would like to learn more about X and Appwrite Auth, we have some resources that you should visit: |
| 65 | + |
| 66 | +- [X Developer Portal](https://developer.twitter.com/en/portal/dashboard) |
| 67 | +- [Implement OAuth login in your apps using Appwrite Auth](/docs/products/auth/oauth2) |
| 68 | +- [Understanding OAuth and OpenID Connect](/blog/post/oauth-openid) |
| 69 | +- [Appwrite Auth API reference](/docs/references/cloud/client-web/account) |
0 commit comments