This page provides instructions on how to configure the Twitter authenticator and Identity Server using a sample app. You can find more information in the following sections.
Info |
---|
This is tested with the Twitter API version 1.1 which uses OAuth 1.0a. Twitter Authenticator is supported by WSO2 Identity Server versions 5.1.0 , 5.2.0 and 5.3.0upwards. |
Table of Contents maxLevel 3 minLevel 3
...
Anchor | ||||
---|---|---|---|---|
|
- Create an account at https://twitter.com and log in.
- Navigate to https://apps.twitter.com/ and click Create New App.
- Provide an application name and description.
- For this tutorial, enter
httphttps://
127.0.0.1
as the website URL. It is used as a placeholder since application used for the tutorial is not publicly available. Give the Callback URL as
https://<HOST_NAME_OF_IS>:9443/commonauth
. For example:https://apps.customhost.com:9443/commonauth
.Info title Note If the Identity Server is running on your local machine, add an entry as mentioned below and use this host name (here
apps.customhost.com
) in your twitter callback url.127.0.0.1 apps.customhost.com
- Click Create your Twitter application.
Note Callback URL is the URL to which the browser should be redirected after the authentication is successful. It should have this format:
https://(host-name):(port)/acs
. Here ACS URL (Assertion Consumer URL) is the endpoint in WSO2 Identity Server which accepts the response sent by googleGoogle.Anchor twitter-app twitter-app - After creating the app, go to the Keys and Access Tokens tab to get the API Key and API Secret. These are the Consumer Key and Consumer Secret values shown.
Example:
Anchor | ||||
---|---|---|---|---|
|
...
Return to the management console.
In the Service Providers section, click Add under the Main tab.
Since you are using travelocity as the sample, enter travelocity.com in the Service Provider Name text box and click Register.
In the Inbound Authentication Configuration section, click Configure under the SAML2 Web SSO Configuration section.
Now set the configuration as follows:
Issuer:
travelocity.com
Assertion Consumer URL:
http://localhost:8080/travelocity.com/home.jsp
Click Add to add the assertion consumer URL.Select the following check-boxes:
Enable Response Signing.
Enable Single Logout.
Enable Attribute Profile.
- Include Attributes in the Response Always.
Click Register to save the changes. Now you will be sent back to the Service Providers page.
Navigate to the Local and Outbound Authentication Configuration section.
Select the identity provider you created from the dropdown list under Federated Authentication.
Ensure that the Federated Authentication radio button is selected and click Update to save the changes.
...
To test the sample, go to the following URL:
http://<TOMCAT_HOST>:<TOMCAT_PORT>/travelocity.com/index.jsp
. E.g., http://localhost:8080/travelocity.comClick the option available to log in with SAML from the WSO2 Identity Server.
You are navigated to the Twitter application. Enter the username and password of your Twitter account to log in.
Example:Once the authentication is complete, you will be taken to the home page of the travelocity.com app.
Example: