예제 #1
0
 /// <remarks/>
 public void GetClientTokenAsync(TokenSpecification specification, object userState) {
     if ((this.GetClientTokenOperationCompleted == null)) {
         this.GetClientTokenOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetClientTokenOperationCompleted);
     }
     this.InvokeAsync("GetClientToken", new object[] {
                 specification}, this.GetClientTokenOperationCompleted, userState);
 }
예제 #2
0
 public string GetClientToken(TokenSpecification specification) {
     object[] results = this.Invoke("GetClientToken", new object[] {
                 specification});
     return ((string)(results[0]));
 }
예제 #3
0
 /// <remarks/>
 public void GetClientTokenAsync(TokenSpecification specification) {
     this.GetClientTokenAsync(specification, null);
 }
예제 #4
0
        private string GetToken()
        {
            TokenService.CommonService commonService = new TokenService.CommonService();
            commonService.Credentials = new NetworkCredential("138906", "my old password");

            // Set the token specification properties
            TokenService.TokenSpecification tokenSpec = new TokenService.TokenSpecification();
            tokenSpec.ClientIPAddress = "71.112.17.158";
            tokenSpec.TokenValidityDurationMinutes = 60;

            string token = "";

            // Get a token
            try
            {
                token = commonService.GetClientToken(tokenSpec);
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return token;
        }