It is possible to authenticate Twitter users with the Twitter authenticator. This authenticator functions as an OAuth 1.0a client to Twitter (i.e., it is a 'consumer'). Using the Curity Identity Server with Twitter requires that an application for a particular installation be defined in Twitter, and that a connection to Twitter is made by configuring the system. The steps to do these two things are described below.
Creating an App in Twitter#
As described in the Twitter documentation, you can create apps that use the Twitter APIs as shown in the following figure:

As you create it, you’ll be shown the API Key and API secret Key. You’ll need these later when configuring the plug-in in Curity.
From the app’s main page, you need to enable OAuth by clicking on the Edit button next to Authentication settings. From there, click on Enable 3-legged OAuth. You may toggle on Request email address from users as well. Configure the callback URL. To obtain this, you’ll need the endpoint of the server and the final part of the URL will be the ID of the Twitter authenticator and the string callback. An example configuration is shown in the following figure:

Also, on the main app page in the Twitter developer portal, you can manage permissions in the Permissions section as shown in the figure below:

Configuring the Twitter Authenticator#
The easiest way to configure a new Twitter authenticator is using the Curity admin UI. The configuration can be downloaded as XML from the CLI and the same can be done using CLI, so only the steps to do this in the GUI will be described.
- Go to the
Authenticatorspage of the authentication profile wherein the authenticator instance should be created. - Click the
New Authenticatorbutton. - Enter a name (e.g.,
twitter1). This name needs to match the URI component in the callback URI set in the Twitter app. - For the type, pick the
Twitteroption:

- On the next page, you can define all of the standard authenticator configuration options like any previous authenticator that should run, the resulting ACR, transformers that should executed, etc. At the top of the configuration page, the Twitter-specific options can be found.
- In the
API Keytextfield, enter theAPI Keyfrom the Twitter client app. - Also enter the
API secret Keygenerated by Twitter when the app was created there.
Once all of these changes are made, they will be staged, but not committed (i.e., not running). To make them active, click the Commit menu option in the Changes menu. Optionally enter a comment in the Deploy Changes dialogue and click OK.
Once the configuration is committed and running, the authenticator can be used like any other.
Source Code#
The source code for the authenticator is available on GitHub. It can make a good starting point new authenticators when needed.