Ejemplo n.º 1
0
 /// <summary>
 /// Client Id and Secret for the OAuth
 /// </summary>
 /// <param name="clientId"></param>
 /// <param name="clientSecret"></param>
 public OAuthTokenCredential(string clientId, string clientSecret)
 {
     this.clientId     = clientId;
     this.clientSecret = clientSecret;
     this.config       = ConfigManager.GetConfigWithDefaults(ConfigManager.Instance.GetProperties());
     this.SdkVersion   = new SDKVersionImpl();
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Client Id and Secret for the OAuth
        /// </summary>
        /// <param name="clientId"></param>
        /// <param name="clientSecret"></param>
        public OAuthTokenCredential(string clientId, string clientSecret, Dictionary <string, string> config)
        {
            this.clientId     = clientId;
            this.clientSecret = clientSecret;
            this.config       = config != null?ConfigManager.GetConfigWithDefaults(config) : ConfigManager.GetConfigWithDefaults(ConfigManager.Instance.GetProperties());

            this.SdkVersion = new SDKVersionImpl();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Client Id and Secret for the OAuth
        /// </summary>
        /// <param name="clientId"></param>
        /// <param name="clientSecret"></param>
        public OAuthTokenCredential(string clientId, string clientSecret, Dictionary <string, string> config)
        {
            this.ClientId     = clientId;
            this.ClientSecret = clientSecret;
            this.config       = config != null?ConfigManager.GetConfigWithDefaults(config) : ConfigManager.GetConfigWithDefaults(ConfigManager.Instance.GetProperties());

            this.SdkVersion = new SDKVersionImpl();
            this.AccessTokenExpirationSafetyGapInSeconds = 120; // Default is 2 minute safety gap for token expiration.
        }
Ejemplo n.º 4
0
        private static IAPICallPreHandler CreateIAPICallPreHandler(Dictionary <string, string> config, Dictionary <string, string> headersMap, string authorizationToken, string requestId, string payLoad, SDKVersion sdkVersion)
        {
            RESTAPICallPreHandler restAPICallPreHandler = new RESTAPICallPreHandler(config, headersMap);

            restAPICallPreHandler.AuthorizationToken = authorizationToken;
            restAPICallPreHandler.RequestId          = requestId;
            restAPICallPreHandler.Payload            = payLoad;
            restAPICallPreHandler.SdkVersion         = sdkVersion;
            return((IAPICallPreHandler)restAPICallPreHandler);
        }