(400) Bad Request on an environment

Jun 26, 2013 at 2:01 PM
Edited Jun 26, 2013 at 2:02 PM
In my local and test environment everything is working as expected, but when it is deployed to the integration environment I get the following error:
LinqToTwitter.TwitterQueryException: Bad Authentication data 
---> System.Net.WebException: The remote server returned an error: (400) Bad Request. at LinqToTwitter.TwitterExecute.QueryTwitter[T](Request request, IRequestProcessor`1 reqProc) 
--- End of inner exception stack trace --- 
at LinqToTwitter.TwitterQueryProvider.Execute[TResult](Expression expression) at LinqToTwitter.TwitterQueryable`1.GetEnumerator() at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source) at line 505
The error occurs on the following line: var tweet1 = tweets[0];

My code is as follows:
 IOAuthCredentials credentials = new InMemoryCredentials();

if (credentials.ConsumerKey == null || credentials.ConsumerSecret == null)
{
    credentials.ConsumerKey = SettingHelper.GetWebsiteSetting("twitterConsumerKey");
    credentials.ConsumerSecret = SettingHelper.GetWebsiteSetting("twitterConsumerSecret");
    credentials.OAuthToken = SettingHelper.GetWebsiteSetting("oAuthToken");
    credentials.AccessToken = SettingHelper.GetWebsiteSetting("accessToken");
}

auth = new SingleUserAuthorizer
{
    Credentials = credentials
};

if (string.IsNullOrWhiteSpace(credentials.ConsumerKey) ||
    string.IsNullOrWhiteSpace(credentials.ConsumerSecret))
{
    // "No credentials.";
    Log.Info("Twitter - No credentials present", (object)this);
}
else if (auth.IsAuthorized)
{
    // "Authorized.";
    try
    {
        var twitterCtx = new TwitterContext(auth);

        var queryResponse =
            (from tweet in twitterCtx.Status
             where tweet.Type == StatusType.User
             select tweet).Take(1);
        var tweets = queryResponse.ToList();
        var tweet1 = tweets[0];
    }
}
Jun 26, 2013 at 3:15 PM
Sorry, it's already resolved. Copy pasting of keys is apparently very hard for some people.