本文整理汇总了C#中TwitterService.VerifyCredentials方法的典型用法代码示例。如果您正苦于以下问题:C# TwitterService.VerifyCredentials方法的具体用法?C# TwitterService.VerifyCredentials怎么用?C# TwitterService.VerifyCredentials使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TwitterService
的用法示例。
在下文中一共展示了TwitterService.VerifyCredentials方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AuthorizeCallback
public ActionResult AuthorizeCallback(string oauth_token, string oauth_verifier)
{
TwitterService service = new TwitterService(_consumerKey, _consumerSecret);
var requestToken = new OAuthRequestToken {Token = oauth_token};
OAuthAccessToken accessToken = service.GetAccessToken(requestToken, oauth_verifier);
service.AuthenticateWith(accessToken.Token, accessToken.TokenSecret);
TwitterUser user = service.VerifyCredentials();
ViewModel.Message = string.Format("Your username is {0}", user.ScreenName);
return View("Index");
}
示例2: Can_verify_credentials
public void Can_verify_credentials()
{
var service = new TwitterService(_consumerKey, _consumerSecret);
service.AuthenticateWith(_accessToken, _accessTokenSecret);
var user = service.VerifyCredentials();
Assert.IsNotNull(user);
}
示例3: VerifyCredentialsWithTwitter
private void VerifyCredentialsWithTwitter()
{
AuthorizationStatus = AuthorizationStatus.Verifying;
var service = new TwitterService(_applicationCredentials.ConsumerKey,
_applicationCredentials.ConsumerSecret,
_accessToken.Token,
_accessToken.TokenSecret);
TwitterUser profile = service.VerifyCredentials();
AuthorizationStatus = profile != null
? AuthorizationStatus.Authorized
: AuthorizationStatus.Unauthorized;
AuthenticatedUser = profile != null
? _userFactory(profile)
: null;
}