예제 #1
0
 private static bool InitCloudABIS()
 {
     //It could be coming from database, app configuration file or a secured source
     _cloudABISAPICredentials = new CloudABISAPICredentials
     {
         BaseAPIURL  = "https://demo-fp.cloudabis.com/v1/",
         AppKey      = "059d8c941ced41a4b11769908f237b31",
         SecretKey   = "eNssBOV0dBxGCJDQaZrrVkzbwns=",
         CustomerKey = "1B2E60DA116D47E9B31AEFB0E5663A04"
     };
     //Init CloudABIS API
     _cloudABISAPI   = new CloudABISAPI(_cloudABISAPICredentials.AppKey, _cloudABISAPICredentials.SecretKey, _cloudABISAPICredentials.BaseAPIURL);
     _cloudABISToken = _cloudABISAPI.GetToken();
     if (!string.IsNullOrEmpty(_cloudABISToken.AccessToken))
     {
         return(true);
     }
     else
     {
         Console.WriteLine("CloudABIS token getting failed: " + _cloudABISToken.ErrorDescription);
         return(false);
     }
 }
예제 #2
0
        /// <summary>
        /// Returns api token if given credentails is correct
        /// </summary>
        /// <returns></returns>
        public CloudABISToken GetCloudABISToken()
        {
            CloudABISAPI cloudABISAPI = new CloudABISAPI(_appkey, _secretKey, _apiBaseUrl);

            return(cloudABISAPI.GetToken());
        }