예제 #1
0
 public TeamworkOAuthInfo(string loginEMailAddress, CompuMaster.Scopevisio.OpenApi.Model.TokenResponse openscopeToken)
 {
     this.Email         = loginEMailAddress;
     this.token_type    = openscopeToken.TokenType.ToString();
     this.TenantId      = openscopeToken.TeamworkTenantId;
     this.UserId        = openscopeToken.Uid;
     this.access_token  = openscopeToken.AccessToken;
     this.refresh_token = openscopeToken.RefreshToken;
     this.expires_in    = openscopeToken.ExpiresIn;
 }
예제 #2
0
 public void TokenTest()
 {
     // TODO uncomment below to test the method and replace null with proper value
     //string grantType = null;
     //string customer = null;
     //string clientId = null;
     //string clientSecret = null;
     //string username = null;
     //long? organisationId = null;
     //string organisation = null;
     //string password = null;
     //string totpResponse = null;
     //string refreshToken = null;
     //string code = null;
     //string requestcookie = null;
     //instance.Token(grantType, customer, clientId, clientSecret, username, organisationId, organisation, password, totpResponse, refreshToken, code, requestcookie);
     CompuMaster.Scopevisio.OpenApi.Model.TokenResponse result = instance.TokenWithHttpInfo("password", instance.Configuration.ClientNumber, null, null, instance.Configuration.Username, null, instance.Configuration.OrganisationName, instance.Configuration.Password, null, null, null, null).Data;
     Assert.IsNotEmpty(result.AccessToken);
     Assert.IsNotEmpty(result.RefreshToken);
     Assert.AreEqual(Model.TokenResponse.TokenTypeEnum.Bearer, result.TokenType);
     Assert.IsNotEmpty(instance.Configuration.AccessToken);
     //Assert.IsNotEmpty(instance.Configuration.RefreshToken);
 }