예제 #1
0
 /// <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
0
        ////////////////////////////////////////////////////////////////////////////

        //////////////////////////////////////////////////////////////////////
        /// <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(); 
            }
        }