예제 #1
0
        //TODO: Throw exceptions
        public static void Initialize(string domainSuffix, string configFileName)
        {
            SetIAMUrl(domainSuffix);
            AddConfigurationData("oauth_configuration");
            if (configFileName != null)
            {
                AddConfigurationData(configFileName);
            }

            //TODO:Delete the following code after completion;
            Console.WriteLine("OAuth Inititalization Configurations:");
            foreach (KeyValuePair <string, string> configuration in configProperties)
            {
                Console.WriteLine(configuration.Key + " : " + configuration.Value);
            }

            //End region;

            ZohoOAuthParams oAuthParams = new ZohoOAuthParams()
            {
                ClientId     = GetConfigValue("client_id"),
                ClientSecret = GetConfigValue("client_secret"),
                AccessType   = GetConfigValue("access_type"),
                RedirectURL  = GetConfigValue("redirect_uri"),
                Scopes       = GetConfigValue("scope")
            };


            ZohoOAuthClient.GetInstance(oAuthParams);
            //TODO: Log the configuration properties;
            //TODO: Refer Java SDK for exceptions;
        }
예제 #2
0
 public static ZohoOAuthClient GetInstance(ZohoOAuthParams oAuthParams)
 {
     client = client ?? new ZohoOAuthClient(oAuthParams);
     return(client);
 }