{"id":68,"date":"2020-10-20T15:20:45","date_gmt":"2020-10-20T15:20:45","guid":{"rendered":"https:\/\/documentation.userswp.io\/article\/twitter-setup-guide\/"},"modified":"2026-08-19T11:25:04","modified_gmt":"2026-08-19T10:25:04","slug":"twitter-setup-guide","status":"publish","type":"gd_place","link":"https:\/\/userswp.io\/documentation\/article\/social-login\/twitter-setup-guide\/","title":{"rendered":"X (Twitter) Setup Guide"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">This article will guide you through setting up X with the Social Login extension for UsersWP using OAuth 2.0 Authorization Code Flow with PKCE. You will need an X account and access to the X Developer Console to create and configure an app.<\/p>\n\n\n<h2>Settings Overview<\/h2>\n<section class=\"alert alert-info\">\n\t You need to have the <a href=\"https:\/\/wordpress.org\/plugins\/userswp-social-login\/\" target=\"_blank\">Social Login<\/a> extension for UsersWP installed and activated in order to access these settings.&nbsp;<\/section>\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Enable X \u2013 <\/strong>Check this option to enable sign-in and registration with X.<\/li>\n\n\n\n<li><strong>X Client ID \u2013 <\/strong>Enter the OAuth 2.0 Client ID from the <strong>Keys and Tokens<\/strong> section of your app in the X Developer Console.<\/li>\n\n\n\n<li><strong>X Client Secret \u2013 <\/strong>Enter the OAuth 2.0 Client Secret generated for your X app. Keep this value private and never expose it publicly.<\/li>\n\n\n\n<li><strong>Let the User Enter the Username? \u2013 <\/strong>If enabled, users will be asked to choose a username. If disabled, UsersWP will automatically generate a username from the information returned by X.<\/li>\n\n\n\n<li><strong>Let the User Enter Email? \u2013 <\/strong>If enabled, users will be asked to enter their email address. If disabled, UsersWP will use the email returned by X when one is available. Enabling this option is recommended if your X app does not return the user&#8217;s email address.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Setting Up X with Social Login<\/h2>\n\n\n\n<ol>\n  <li>Go to the <a href=\"http:\/\/developer.x.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">X Developer Console<\/a> and sign in.<\/li>\n  <li>Create a new project and app, or select an existing app.<\/li>\n  <li>Open your app&#8217;s authentication settings and enable <strong>OAuth 2.0<\/strong>.<\/li>\n  <li>Select <strong>Web App<\/strong>, <strong>Automated App<\/strong>, or another confidential-client app type that provides a Client Secret.<\/li>\n  <li>Configure the app permissions required for social login.<\/li>\n  <li>Add the callback URL displayed under <strong>UsersWP &gt; Social &gt; X<\/strong> to the app&#8217;s allowed callback or redirect URLs. The URL must match exactly.<\/li>\n  <li>If requested by X, enter your website URL and complete the remaining app information.<\/li>\n  <li>Open the <strong>Keys and Tokens<\/strong> section and generate or copy the OAuth 2.0 <strong>Client ID<\/strong> and <strong>Client Secret<\/strong>.<\/li>\n  <li>In WordPress, navigate to <strong>UsersWP &gt; Social &gt; X<\/strong>.<\/li>\n  <li>Enter the OAuth 2.0 <strong>Client ID<\/strong> and <strong>Client Secret<\/strong> in the corresponding fields.<\/li>\n  <li>Check the <strong>Enable X<\/strong> option.<\/li>\n  <li>Click <strong>Save changes<\/strong>.<\/li>\n  <li>Open your login or registration page in a private browser window and test the X sign-in process.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Required OAuth 2.0 Scopes<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The integration requests the following OAuth 2.0 scopes:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>tweet.read<\/code> \u2013 Allows the app to read permitted post data.<\/li>\n\n\n\n<li><code>users.read<\/code> \u2013 Allows the app to read the authenticated user&#8217;s profile.<\/li>\n\n\n\n<li><code>users.email<\/code> \u2013 Requests access to the user&#8217;s email address when available and permitted.<\/li>\n\n\n\n<li><code>offline.access<\/code> \u2013 Allows the app to receive a refresh token.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>This article will guide you through setting up X with the Social Login extension for UsersWP using OAuth 2.0 Authorization Code Flow with PKCE. You will need an X account and access to the X Developer Console to create and configure an app. Settings Overview You need to have the Social Login extension for UsersWP [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"article\/tags":[83,100,130],"article\/categories":[5,16],"class_list":["post-68","gd_place","type-gd_place","status-publish","hentry","gd_place_tags-social-login","gd_place_tags-userswp-extensions","gd_place_tags-twitter","gd_placecategory-extensions-features","gd_placecategory-social-login"],"_links":{"self":[{"href":"https:\/\/userswp.io\/documentation\/wp-json\/wp\/v2\/article\/68","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/userswp.io\/documentation\/wp-json\/wp\/v2\/article"}],"about":[{"href":"https:\/\/userswp.io\/documentation\/wp-json\/wp\/v2\/types\/gd_place"}],"author":[{"embeddable":true,"href":"https:\/\/userswp.io\/documentation\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/userswp.io\/documentation\/wp-json\/wp\/v2\/comments?post=68"}],"version-history":[{"count":0,"href":"https:\/\/userswp.io\/documentation\/wp-json\/wp\/v2\/article\/68\/revisions"}],"wp:attachment":[{"href":"https:\/\/userswp.io\/documentation\/wp-json\/wp\/v2\/media?parent=68"}],"wp:term":[{"taxonomy":"gd_place_tags","embeddable":true,"href":"https:\/\/userswp.io\/documentation\/wp-json\/wp\/v2\/article\/tags?post=68"},{"taxonomy":"gd_placecategory","embeddable":true,"href":"https:\/\/userswp.io\/documentation\/wp-json\/wp\/v2\/article\/categories?post=68"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}