Error occurs while configuring Twitter integration
Error occurs while configuring Twitter integration for Pega Customer Service (CS) 7.31. This occurs when authorizing an OAuth profile.
The request token for this page is invalid. It may have been already been used, or expired because it is too old. Please go back to the site or application that sent you here and try again; it was probably just a mistake.
Steps to Reproduce
- Create a new Twitter application.
- Generate tokens and perform all the required configurations for Twitter.
- Launch the Interaction portal.
- Navigate to Operator Preferences.
- Authorize for Twitter.
Due to recent updates from Twitter, callback URLs are mandatory to authorize the Twitter application.
Pega generates the callback URLs dynamically in the 'pyGetRequestToken' activity (if changes from the platform are received). Additionally, the same callback URL must be provided explicitly in the Twitter application.
For example: https://<LocalHost>/prweb?pyActivity=@baseclass.GenerateTwitterTokens
For this, the requestor and thread ID must be passed dynamically. As part of implementation, the URL is passed accordingly and the required parameters are set dynamically in the 'GenerateTwitterTokens' and 'pyGetAccessTokens' activities.
The callback URL format is 'http://<LocalHost:portnumber>/prweb?pyActivity=Data-Admin-Security-OAuth-Client.GenerateTwitter'. This is generated in Pega. To authorize the Twitter application, the URL generated in Pega must be provided in the Twitter application callback URL.