Twitter Social Login Configuration Guide


Twitter is a social news and networking site with more than 300 million active users each month.

Before You Begin

To use Twitter for social login you must:

  1. Obtain a Twitter developer’s account from https://apps.twitter.com.
  2. Do one of the following:
    • Open a previously-created Twitter app, and copy the consumer key (API key) and consumer secret (API secret).
    • Create a new Twitter app and copy the consumer key and consumer secret.
       
  3. Use the Janrain Dashboard and the Twitter consumer key and consumer secret to configure Twitter as a social login provider.

In This Configuration Guide

  • Creating a Twitter App for Social Login
  • Using an Existing Twitter App for Social Login
  • Configuring Twitter as a Social Login Provider
  • Testing Twitter Social Login
  • Assigning a Different Twitter App for Social Login
  • Removing Twitter as a Social Login Provider

Creating a Twitter App for Social Login

This section walks you through the process of creating a Twitter app for social login. If you already have an app, see the Using an Existing Twitter App for Social Login section of this documentation.

To create a Twitter app, complete the following procedure:

  1. Log on to the Twitter Apps (https://apps.twitter.com) site.
  2. From the Twitter Apps home page, click Create New App:

  1. On the Create an Application page, enter:
    • The name of your application in the Name field.
    • A brief description of your application in the Description field.
    • The URL of your website in the Website field.
    • Your Twitter callback URL in the Callback URL field. If you are using a standard Janrain domain, your callback URL will look similar to this: https://greg-stemp.rpxnow.com/twitter/callback.
       
  2. Select Yes, I have read and agree to the Twitter Developer Agreement and then click Create your Twitter application:

  1. On the Application Settings page, under Token Actions, click Create my access token:

  1. Click Keys and Access Tokens:

  1. From the Keys and Access Tokens tab, copy the Consumer Key (API Key) and the Consumer Secret (API Secret). You can copy this information to a text editor, then close the text editor after you have configured Janrain social login:

  1. Log off from Twitter Apps.

Using an Existing Twitter App for Social Login

If you already have a Twitter app for social login, complete the following steps to retrieve the application’s API key and API secret:

  1. Log on to the Twitter Apps home page (https://app.twitter.com).
  2. From the Twitter Apps home page, click the name of the app you want to use to configure social login:

  1. From the home page for your app, click Keys and Access Tokens:

  1. From the Keys and Access Tokens tab, copy the Consumer Key (API Key) and the Consumer Secret (API Secret). You can copy this information to a text editor, then close the text editor after you have configured Janrain social login:

  1. Log off from Twitter Apps.

Configuring Twitter as a Social Login Provider

To configure Twitter as a social login provider, make sure you have your Twitter consumer key and consumer secret, and then complete the following procedure:

  1. Log on to your Janrain Dashboard (https://dashboard.janrain.com).
  2. From the Dashboard home page, click the Manage Engage Dashboard icon.
  3. From the Engage Dashboard home page, in the Widgets and SDKs section, click Sign-Ins.
  4. From the Sign-in page, verify that Widget is selected and then expand Providers.
  5. From the list of Providers, click Twitter.
  6. In the Twitter dialog box, click Next until you reach the screen requesting the API key and API secret:

  1. Paste your Twitter consumer key in the API Key field, paste your Twitter consumer secret in the API Secret field, and then click Save. Twitter appears in your social login widget.
  2. When you are finished, select Save and Publish and then click Publish. It might take as long as one hour before Twitter appears as a social login option on your web site.

Testing Twitter Social Login

To test Twitter social login, complete the following procedure:

  1. Do one of the following:
    • If you have just published your widget settings, click the Test your widget link that appears after the widget has been saved.
    • If you previously published your widget settings then, from the Engage Dashboard Sign-in page, click Launch a test widget.
       
  2. From the Test page, click the Twitter icon:

  1. In the Twitter / Authorize an application window, logon using a valid Twitter account:

  1. If login succeeds, information returned from the Twitter profile is displayed in the API response preview field:

The returned profile information will vary depending on the Twitter account used in the test.

You can verify Twitter profile fields by completing the following procedure:

  1. From the Engage Dashboard home page, click the Manage Providers icon:

  1. From the Configure Providers page, click Twitter.
  2. Profile information returned from Twitter is displayed onscreen. For example:

See Also

Assigning a Different Twitter App for Social Login

If you want to use a different Twitter app or if you need to change your existing app, you must update the Twitter provider configuration settings. To do that, complete the following procedure:

  1. From the Engage Dashboard home page, click the Manage Providers icon:

  1. From the Configure Providers page, click Twitter.
  2. Click the green Configured button to display the Twitter is currently enabled dialog box:

  1. To change the Twitter configuration, click Modify these settings.
  2. In the Twitter dialog box, change the App Key and/or App Secret as needed, and then click Save:

Although you can modify your Twitter settings, you cannot delete those settings. If you delete the settings and then try to save your changes, you’ll see the error message Please enter your Consumer Key and Secret exactly as Twitter shows them.

This means that you cannot “unconfigure” the provider: once configured, the Twitter icon will always be shown as green (i.e., configured) in the Janrain Dashboard.

Removing Twitter as a Social Login Provider

If you no longer want to use Twitter for social login, you can remove Twitter as a social login provider by completing the following procedure:

  1. Log on to your Janrain Dashboard (https://dashboard.janrain.com).
  2. From the Dashboard home page, click the Manage Engage Dashboard icon.
  3. From the Engage Dashboard home page, in the Widgets and SDKs section, click Sign-Ins.
  4. From the Sign-in page, verify that Widget is selected and then expand Providers.
  5. In the widget, click the X in the upper right corner of the Twitter icon.
  6. Scroll to the bottom of the page, select Save and Publish, and then click Publish. Twitter no longer appears in the sign-on widget.
Note. You must always have at least one social login provider in the widget. If you delete all the providers and then click Publish, you’ll see the error message Couldn’t save configuration: No providers.