I'm having some issue authorizing twitter on the application of mine.
Here is what my authorization code looks like
I'm hoping someone can help me as I already tried another 3rd party client and this is starting to anger me.
Thanks.
Here is what my authorization code looks like
public Uri CreateOptInUrl(string redirectUri)
{
var applicationCredentials = CredentialsCreator.GenerateApplicationCredentials(Settings.ApiKey, Settings.ApiSecret);
var url = CredentialsCreator.GetAuthorizationURLForCallback(applicationCredentials, redirectUri);
return new Uri(url);
}
the issue comes when I return to my application and my callback code fires: public IExternalApp HandleOptInResponse(HttpRequestBase request, string redirectUri)
{
try
{
IExternalApp app = new ExternalApp {ExternalAppType = ExternalAppType.Twitter};
var data = request.Params;
var applicationCredentials = CredentialsCreator.GenerateApplicationCredentials(Settings.ApiKey, Settings.ApiSecret);
var verifyAuth = CredentialsCreator.GetCredentialsFromVerifierCode(data["oauth_verifier"], applicationCredentials);
var usr = Tweetinvi.User.GetLoggedUser();
app.Uid = usr.Id;
app.Token = verifyAuth.AccessToken;
app.TokenSecret = verifyAuth.AccessTokenSecret;
app.Username = usr.ScreenName;
app.Name = usr.Name;
return app;
}
catch
{
return null;
}
}
verifyAuth come back as null which usr then is null.I'm hoping someone can help me as I already tried another 3rd party client and this is starting to anger me.
Thanks.