JBoss Community Archive (Read Only)

GateIn Portal 3.8

Twitter

Twitter is another social network, which could be integrated with GateIn Portal. It doesn't support OAuth 2.0 protocol, but OAuth 1.0a. Integration with GateIn Portal consists of two main parts:

Registration of portal application on Twitter

These instructions assume that your host is server.local.network.com as described in Basic integration steps.

  1. Main twitter page for developers is https://dev.twitter.com/ . From this page, you can go to API console and register new application. You can choose any name or description as you want. For Website you can use http://server.local.network.com:8080 and for Callback URL you can use http://server.local.network.com:8080/portal/twitterAuth

    images/author/download/attachments/78709349/twitter-create-app.png
    Creating application in Twitter
Callback URL is a mandatory field

The "Callback URL" must be filled for Twitter to recognize that it is a web application which is trying to connect. Twitter will not accept "http://localhost:8080/portal" as a valid URL but you can use any, even "http://www.twitter.com". This field will be ignored but it can't remain empty.

  1. Once application is created, you can edit it and in tab Settings you may need to enable Sign in with Twitter checkbox. It's recommended to enable it, otherwise your users will need to authorize in Twitter after each login into
    GateIn Portal. For Access option, it's sufficient for our purpose to use default value Read only.

  2. After finish of whole process, you should see in Details tab settings similar to those:

    images/author/download/attachments/78709349/twitter-app-registration-summary.png
    Twitter application registration summary
  3. Again, make sure to remember clientId and clientSecret because these will be needed in GateIn Portal configuration.

Portal configuration

On portal side, you need to change file configuration.properties and configure properties in Twitter section like:

## Twitter
gatein.oauth.twitter.enabled=true
gatein.oauth.twitter.clientId=JBBAkYseVCzStLhhOQ
gatein.oauth.twitter.clientSecret=Ihi1txdiasrjMJoisRFvBaUjVq1K87gJNKW7VCbY
gatein.oauth.twitter.redirectURL=${gatein.oauth.portal.url}/@@portal.container.name@@/twitterAuth

Description of properties:

  • gatein.oauth.twitter.enabled - This will enable integration with Twitter. Users will now be able to login and register with Twitter

  • gatein.oauth.twitter.clientId - Client ID of your application. This comes from registration on Twitter as described in previous section

  • gatein.oauth.twitter.clientSecret - Client Secret of your application. This comes from registration on Twitter as described in previous section. Note that client secret should be kept secret and it shouldn't be shared among your portal users or other people.

  • gatein.oauth.twitter.redirectURL - URL, which will be used by Twitter to redirect after user confirms Twitter authorization screen (Step 3 of Registration flow). Normally you don't need to change this value as long as you changed property gatein.oauth.portal.url as described in Basic integration steps .

After restart of GateIn Portal, your users should be able to register or login with their Twitter accounts as described in UI flows .

JBoss.org Content Archive (Read Only), exported from JBoss Community Documentation Editor at 2020-03-10 13:21:35 UTC, last content change 2013-05-29 15:23:47 UTC.