本文整理汇总了C#中Google.GData.Client.Service.QueryAuthenticationToken方法的典型用法代码示例。如果您正苦于以下问题:C# Service.QueryAuthenticationToken方法的具体用法?C# Service.QueryAuthenticationToken怎么用?C# Service.QueryAuthenticationToken使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Google.GData.Client.Service
的用法示例。
在下文中一共展示了Service.QueryAuthenticationToken方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetNewAuthenticationToken
/// <summary>
/// Generates a new Authentication Toklen for AppsService
/// with the specified credentials for accessing provisioning feeds on the specified domain.
/// </summary>
/// <param name="domain">the domain to access</param>
/// <param name="adminEmailAddress">the administrator's email address</param>
/// <param name="adminPassword">the administrator's password</param>
/// <returns>the newly generated authentication token</returns>
public static String GetNewAuthenticationToken(string domain, string adminEmailAddress, string adminPassword)
{
Service service = new Service(AppsNameTable.GAppsService,"apps-"+domain);
service.setUserCredentials(adminEmailAddress, adminPassword);
return service.QueryAuthenticationToken();
}
示例2: TestFactoryCredentialRetrieval
////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
/// <summary>runs an authentication test</summary>
//////////////////////////////////////////////////////////////////////
[Test] public void TestFactoryCredentialRetrieval()
{
Tracing.TraceMsg("Entering TestFactoryCredentialRetrieval");
Service service = new Service("lh2", "test");
if (this.defaultUri != null)
{
if (this.userName != null)
{
service.Credentials = new GDataCredentials(this.userName, this.passWord);
}
string token = service.QueryAuthenticationToken();
}
}