Third-Party Logins: Twitter

Collapse
X
Collapse
  •  

  • Third-Party Logins: Twitter

    You will need to use an existing twitter account in order to use this functionality.

    Create an app using your twitter account

    In your browser go to https://apps.twitter.com/app/new

    Check App Settings

    Go to the application settings (e.g. https://apps.twitter.com/app/12345/settings where 12345 references the app created in step 2. You can access the settings by going to the list of
    your apps (https://apps.twitter.com), clicking on the app link, then clicking on the "Settings" tab.
    1. Fill in the "Name", "Description", "Website", and "Callback URL" fields.
    2. For the "Callback URL" field, it should be {forumurl}/twitterlogin/auth_callback (e.g.
    3. https://yourdomain.com/yourforum/twi.../auth_callback )
    4. Make sure to check "Allow this application to be used to Sign in with Twitter".
    5. Both "Callback URL" and "Allow this application to be used to Sign in with Twitter" settings
    6. are REQUIRED for connect & log-in features.
    7. Remember to click "Update Settings" before moving on.

    App Key & Secret

    After saving the settings, go to the "Keys and Access Tokens" tab. Save the "Consumer Key (API Key)" and "Consumer Secret (API Secret)" values somewhere secure. DO NOT SHARE THESE VALUES.

    The "Consumer Key (API Key)" and "Consumer Secret (API Secret)" will be saved in the vBulletin settings "Twitter App Consumer Key (API Key)" and "Twitter App Consumer Secret
    (API Secret)", respectively. These options are found in the AdminCP under Settings -> Options -> "Third Party Login Options".

    Request Emails (optional)

    To allow auto-populating the email field when a guest registers with twitter, go to the application permissions (e.g. https://apps.twitter.com/app/12345/permissions) and check the
    "Request email addresses from users" checkbox under "Additional Permissions".
    Note: This will require you fill in the "Privacy Policy URL" & "Terms of Service URL" fields in the application settings.


    Regular connect & log-in will work without this additional permission. Connecting to twitter at registration will also work without this additional permission, but the email will not be auto-populated on the registration form. Also note that the email may not be populated even with this setting if the twitter account has not verified their email.

    vBulletin Settings

    Install or upgrade to vBulletin 5.4.1. If you upgraded and product & hook system is disabled, you must enable the system.
    Note: Cloud Customers can skip steps 1 through 3. To access the Twitter settings go to Settings -> Options -> Third Party Login Options.
    1. In Admin Control Panel (Admin CP) go to "Products & Hooks" > "Manage Products". If the product & hook system is disabled, there will be a link at the top of this page to enable it.
    2. You should see "Third Party Login - Twitter" as one of the installed products on this page.
    3. Click on the "Enable Sign-in with Twitter" under "Related Options".
    4. Set "Enable Sign-in with Twitter" to "Yes", and enter the "Consumer Key (API Key)" and
    5. "Consumer Secret (API Secret)" values from step 4 to "Twitter App Consumer Key (API Key)" and
    6. "Twitter App Consumer Secret (API Secret)", respectively.
    7. (Optional) Set "Enable Registration with Twitter" to allow new users to connect their twitter
    8. accounts during registration.
    9. Save the settings.


    Connect/disconnect Twitter account

    Your forum's members should now be able to connect (or disconnect) their twitter accounts. Existing members can do so via the "Third-party Login Providers" section of their user settings
    page after logging into the forum ({forumurl}/settings/account) and clicking on the "Connect to Twitter" button (or "Disconnect from Twitter" button if they are already connected) in
    that section. Members will also be able to sign in via Twitter by selecting the appropriate icon on the login form.

    If "Enable Sign-in with Twitter" was enabled, new users can connect their Twitter accounts during registration via the "Connect to Twitter" button at the top of the registration form.


    • NiGh10GaLe
      #1
      NiGh10GaLe commented
      Editing a comment
      Thanx for that.
      But, what about google login??
      What is the callback URL used??

    • Wayne Luke
      #2
      Wayne Luke commented
      Editing a comment
      We build the callback URL for Google Login in the code. The only values you need are the ones listed on the settings page.
    Posting comments is disabled.

About the Author

Collapse

Wayne Luke A curious juxtaposition of nature, technology and sustainability. Find out more about Wayne Luke

Article Tags

Collapse

administration (1) beginner (3) calendar (1) cloud (1) Custom (1) database (2) Google (1) how-to (2) howto (1) how to (1) https (1) Intermediate (4) MYSQL (2) performance (2) recovery tools (1) security (2) seo (1) server information (1) sftp (1) ssl (1) style (1) tls (1) tutorial (4) vb5howto (5) vbcloud (1)

Latest Articles

Collapse

  • Understanding MySQL's Table Status Output
    by Wayne Luke

    AdminCP → Maintenance → Diagnostics → System Information MySQL's SHOW TABLE STATUS command helps gather information about tables in a database. When executed, it provides a detailed overview of various metrics related to each table in the database. This information can be valuable for database administrators and developers to optimize performance, troubleshoot issues, and better understand their databases' structure. Let's delve into the output of MySQL's SHOW TABLE STATUS command and underst...

    Thu 22 Feb '24, 10:13am
  • vbevent.php
    by Wayne Luke
    (vBulletin 6+) This script will handle running the vbulletin offline events (Such as sending notifications for a post). This avoids having users trigger AJAX calls when hitting the site. It also avoids the problem where the background tasks fail to run because there is not enough traffic to trigger all of the scripts in a timely fashion. To use do the following: Copy the script from the do_not_upload directory of your vBulletin files to your web server. Preferably outside of the web root directory. S...
    Mon 8 Jan '24, 10:28am
  • vbcron.php
    by Wayne Luke

    This script will handle running the vbulletin schedule tasks (see the Scheduled Tasks menu in the Admincp). This avoids having users trigger ajax calls when hitting the site. It also avoids the problem where the scheduled tasks fail to run because there is not enough site traffic to trigger all of the scripts in a timely fashion.

    To use do the following

    1. You will find this script in your do_not_upload directory. Copy the script to your web server. Preferably outside of the w...
    Mon 8 Jan '24, 10:24am
  • Changing your site's favicon
    by Wayne Luke
    The favicon allows you to extend your brand identity to the browser tab. This can often be the only thing a user sees if they have many tabs open. The favicon is a special 16 X 16 icon that the browser automatically looks for in the root directory of your site. vBulletin also ships with one in its root directory. If vBulletin is installed in the root directory of your site, you can overwrite the provided icon to change it for your users. However, you will need to remember to do this with every version...
    Tue 21 Nov '23, 10:39am
  • Common Mime Types
    by Wayne Luke
    vBulletin allows the upload of file attachments. Servers and browsers generally recognize the type of file using two methods; file extensions and MIME types. This document is to allow you to match extensions with MIME types so they are properly handled by browsers. table {width: 80%; margin-left:auto; margin-right:auto} table td:first-child { text-align:center} tr:nth-child(even) {background: #CCC} tr:nth-child(odd) {background: #FFF} th{ color: white; background: black; }​​ Media Images ...
    Tue 21 Nov '23, 10:30am
  • About .htaccess
    by Wayne Luke
    .htaccess is a configuration file for the Apache Web Server. It allows you to customize how your server works. Depending on how your hosting provider has the server configured, you can redirect people to different locations, secure directories and files, tell browsers how long to cache files, update PHP variables, and more. vBulletin comes with a pretty extensive .htaccess file that does a these things for you. Location vBulletin comes with a file named htaccess.txt in the original download. When ...
    Mon 11 Sep '23, 11:57am
Working...