public PushServiceSocket(String serviceUrl, TrustStore trustStore, CredentialsProvider credentialsProvider, string userAgent) { this.serviceUrl = serviceUrl; this.credentialsProvider = credentialsProvider; this.userAgent = userAgent; //this.trustManagers = BlacklistingTrustManager.createFor(trustStore); }
public WebSocketConnection(String httpUri, TrustStore trustStore, CredentialsProvider credentialsProvider, string userAgent) { this.trustStore = trustStore; this.credentialsProvider = credentialsProvider; this.wsUri = httpUri.Replace("https://", "wss://") .Replace("http://", "ws://") + $"/v1/websocket/?login={credentialsProvider.GetUser()}&password={credentialsProvider.GetPassword()}"; this.userAgent = userAgent; }
/** * Construct a TextSecureMessageReceiver. * * @param url The URL of the TextSecure server. * @param trustStore The {@link org.whispersystems.textsecure.api.push.TrustStore} containing * the server's TLS signing certificate. * @param credentials The TextSecure user's credentials. */ public TextSecureMessageReceiver(String url, TrustStore trustStore, CredentialsProvider credentials, string userAgent) { this.url = url; this.trustStore = trustStore; this.credentialsProvider = credentials; this.socket = new PushServiceSocket(url, trustStore, credentials, userAgent); this.userAgent = userAgent; }
protected override void Before_each_spec() { _theUnit = new CredentialsProvider<FakeAuthentication>(); _mockContainer = Mock<IWindsorContainer>(); Locator.Initialize(_mockContainer); _theUnit.IsAuthenticating = true; _theUnit.SessionTicket = Guid.NewGuid(); }
public TextSecureMessagePipe(WebSocketConnection websocket, CredentialsProvider credentialsProvider) { this.websocket = websocket; this.websocket.MessageReceived += OnMessageReceived; this.credentialsProvider = credentialsProvider; this.websocket.connect(); }
public RouteCalculator( CredentialsProvider credentialsProvider, string to, string from, Dispatcher uiDispatcher, Action<RouteResponse> routeFound) { if (credentialsProvider == null) { throw new ArgumentNullException("credentialsProvider"); } if (string.IsNullOrEmpty(to)) { throw new ArgumentNullException("to"); } if (string.IsNullOrEmpty(from)) { throw new ArgumentNullException("from"); } if (uiDispatcher == null) { throw new ArgumentNullException("uiDispatcher"); } if (routeFound == null) { throw new ArgumentNullException("routeFound"); } _credentialsProvider = credentialsProvider; _to = to; _from = from; _uiDispatcher = uiDispatcher; _routeFound = routeFound; _geocodeClient = new GeocodeServiceClient(); _geocodeClient.GeocodeCompleted += client_GeocodeCompleted; _routeClient = new RouteServiceClient(); _routeClient.CalculateRouteCompleted += client_RouteCompleted; }
public MapViewModel(CredentialsProvider credentialsProvider, ILinienMapper linienMapper) { if (credentialsProvider == null) throw new ArgumentNullException("credentialsProvider"); if (linienMapper == null) throw new ArgumentNullException("linienMapper"); CredentialsProvider = credentialsProvider; _LinienMapper = linienMapper; Pushpins = new ObservableCollection<VtmPushpin>(); PolyLines = new ObservableCollection<MapPolyline>(); _linien = _LinienMapper.HaltestellenOrdered; _initFilters(); // Startpunkt: Wien Stephansdom Center = new Location(48.208333, 16.372778); ZoomLevel = 13.0; }
/// <summary> /// 默认构造函数, /// 注意如果使用此方法 httpRequestConfig 使用的http 请求 schema 为Https /// </summary> /// <param name="credentialsProvider">认证信息</param> public KubernetesClient(CredentialsProvider credentialsProvider) { this.credentialsProvider = credentialsProvider; }
/// <summary> /// 默认构造函数 /// </summary> /// <param name="credentialsProvider">认证信息</param> /// <param name="httpRequestConfig">http 客户端配置信息</param> /// <param name="environment">sdk 环境配置信息</param> public KubernetesClient(CredentialsProvider credentialsProvider, HttpRequestConfig httpRequestConfig, SDKEnvironment environment) { this.httpRequestConfig = httpRequestConfig; this.credentialsProvider = credentialsProvider; this.environment = environment; }
/// <summary> /// 默认构造函数 /// </summary> /// <param name="httpRequestConfig">http 客户端配置信息</param> /// <param name="credentialsProvider">认证信息</param> public CloudauthClient(CredentialsProvider credentialsProvider, HttpRequestConfig httpRequestConfig) { this.httpRequestConfig = httpRequestConfig; this.credentialsProvider = credentialsProvider; }
/// <summary> /// 默认构造函数, /// 注意如果使用此方法 httpRequestConfig 使用的http 请求 schema 为Https /// </summary> /// <param name="credentialsProvider">认证信息</param> public DcapClient(CredentialsProvider credentialsProvider) { this.credentialsProvider = credentialsProvider; }
/// <summary> /// 默认构造函数, /// 注意如果使用此方法 httpRequestConfig 使用的http 请求 schema 为Https /// </summary> /// <param name="credentialsProvider">认证信息</param> public YundingClient(CredentialsProvider credentialsProvider) { this.credentialsProvider = credentialsProvider; }
/// <summary> /// 默认构造函数, /// 注意如果使用此方法 httpRequestConfig 使用的http 请求 schema 为Https /// </summary> /// <param name="credentialsProvider">认证信息</param> public CompileClient(CredentialsProvider credentialsProvider) { this.credentialsProvider = credentialsProvider; }
/// <summary> /// 默认构造函数 /// </summary> /// <param name="httpRequestConfig">http 客户端配置信息</param> /// <param name="credentialsProvider">认证信息</param> public NativecontainerClient(CredentialsProvider credentialsProvider, HttpRequestConfig httpRequestConfig) { this.httpRequestConfig = httpRequestConfig; this.credentialsProvider = credentialsProvider; }
/// <summary> /// 默认构造函数, /// 注意如果使用此方法 httpRequestConfig 使用的http 请求 schema 为Https /// </summary> /// <param name="credentialsProvider">认证信息</param> public MongodbClient(CredentialsProvider credentialsProvider) { this.credentialsProvider = credentialsProvider; }
public async Task <User> FindByProviderId(CredentialsProvider provider, string providerId) { var entity = await repository.FindByProviderId(provider.ToString(), providerId); return(entity?.ToModel()); }
protected override void Load(ContainerBuilder builder) { base.Load(builder); builder.Register(c => CredentialsProvider.ForUsernameAndPassword(userName, password)) .As <ICredentialsProvider>(); }
public static void ReverseGeocodeAddress(Dispatcher uiDispatcher, CredentialsProvider credentialsProvider, Location location, Action<GeocodeResult> completed = null, Action<GeocodeError> error = null) { completed = completed ?? (r => { }); error = error ?? (e => { }); // Get credentials and only then place an async call on the geocode service. credentialsProvider.GetCredentials(credentials => { var request = new ReverseGeocodeRequest() { // Pass in credentials for web services call. Credentials = credentials, Culture = CultureInfo.CurrentUICulture.Name, Location = location, // Don't raise exceptions. ExecutionOptions = new UsingBingMaps.Bing.Geocode.ExecutionOptions { SuppressFaults = true }, }; EventHandler<ReverseGeocodeCompletedEventArgs> reverseGeocodeCompleted = (s, e) => { try { if (e.Result.ResponseSummary.StatusCode != UsingBingMaps.Bing.Geocode.ResponseStatusCode.Success || e.Result.Results.Count == 0) { // Report geocode error. uiDispatcher.BeginInvoke(() => error(new GeocodeError(e))); } else { // Only report on first result. var firstResult = e.Result.Results.First(); uiDispatcher.BeginInvoke(() => completed(firstResult)); Debug.WriteLine("street=" + firstResult.Address.AddressLine.ToString()); Debug.WriteLine("admin district=" + firstResult.Address.AdminDistrict.ToString()); Debug.WriteLine("country region=" + firstResult.Address.CountryRegion.ToString()); Debug.WriteLine("district=" + firstResult.Address.District.ToString()); Debug.WriteLine("formatted addres=" + firstResult.Address.FormattedAddress.ToString()); Debug.WriteLine("locality=" + firstResult.Address.Locality.ToString()); Debug.WriteLine("postal code=" + firstResult.Address.PostalCode.ToString()); Debug.WriteLine("postal town=" + firstResult.Address.PostalTown.ToString()); CurrentAddress = firstResult.Address.FormattedAddress.ToString(); CurrentAddress_AdminDistrict = firstResult.Address.AdminDistrict.ToString(); CurrentAddress_CountryRegion = firstResult.Address.CountryRegion.ToString(); CurrentAddress_Locality = firstResult.Address.Locality.ToString(); CurrentAddress_PostalCode = firstResult.Address.PostalCode.ToString(); CurrentAddress_AddressLine = firstResult.Address.AddressLine.ToString(); } } catch (Exception ex) { uiDispatcher.BeginInvoke(() => error(new GeocodeError(ex.Message, ex))); } }; var geocodeClient = new GeocodeServiceClient(); geocodeClient.ReverseGeocodeCompleted += reverseGeocodeCompleted; geocodeClient.ReverseGeocodeAsync(request); }); }
/// <param name="credentialsProvider"> /// the /// <see cref="NGit.Transport.CredentialsProvider">NGit.Transport.CredentialsProvider /// </see> /// to use /// </param> /// <returns> /// /// <code>this</code> /// </returns> public virtual CloneCommand SetCredentialsProvider(CredentialsProvider credentialsProvider ) { this.credentialsProvider = credentialsProvider; return(this); }
/// <summary> /// 默认构造函数 /// </summary> /// <param name="credentialsProvider">认证信息</param> /// <param name="httpRequestConfig">http 客户端配置信息</param> /// <param name="environment">sdk 环境配置信息</param> public ContainerregistryClient(CredentialsProvider credentialsProvider, HttpRequestConfig httpRequestConfig, SDKEnvironment environment) { this.httpRequestConfig = httpRequestConfig; this.credentialsProvider = credentialsProvider; this.environment = environment; }
/// <summary> /// 默认构造函数, /// 注意如果使用此方法 httpRequestConfig 使用的http 请求 schema 为Https /// </summary> /// <param name="credentialsProvider">认证信息</param> public NativecontainerClient(CredentialsProvider credentialsProvider) { this.credentialsProvider = credentialsProvider; }
/// <summary> /// 默认构造函数, /// 注意如果使用此方法 httpRequestConfig 使用的http 请求 schema 为Https /// </summary> /// <param name="credentialsProvider">认证信息</param> public LogsClient(CredentialsProvider credentialsProvider) { this.credentialsProvider = credentialsProvider; }
/// <summary> /// 设置认证信息参数 /// </summary> /// <param name="provider">认证信息提供对象</param> /// <returns>nativecontainerClient 构造器</returns> public Builder CredentialsProvider(CredentialsProvider provider) { nativecontainerClient.credentialsProvider = provider; return(this); }
/// <summary> /// 默认构造函数 /// </summary> /// <param name="httpRequestConfig">http 客户端配置信息</param> /// <param name="credentialsProvider">认证信息</param> public YundingClient(CredentialsProvider credentialsProvider, HttpRequestConfig httpRequestConfig) { this.httpRequestConfig = httpRequestConfig; this.credentialsProvider = credentialsProvider; }
/// <summary> /// 默认构造函数, /// 注意如果使用此方法 httpRequestConfig 使用的http 请求 schema 为Https /// </summary> /// <param name="credentialsProvider">认证信息</param> public HufuClient(CredentialsProvider credentialsProvider) { this.credentialsProvider = credentialsProvider; }
/// <summary> /// 设置认证信息参数 /// </summary> /// <param name="provider">认证信息提供对象</param> /// <returns>dcapClient 构造器</returns> public Builder CredentialsProvider(CredentialsProvider provider) { dcapClient.credentialsProvider = provider; return(this); }
/// <exception cref="Apache.Http.Auth.MalformedChallengeException"></exception> public virtual Queue <AuthOption> Select(IDictionary <string, Header> challenges, HttpHost authhost, HttpResponse response, HttpContext context) { Args.NotNull(challenges, "Map of auth challenges"); Args.NotNull(authhost, "Host"); Args.NotNull(response, "HTTP response"); Args.NotNull(context, "HTTP context"); HttpClientContext clientContext = ((HttpClientContext)HttpClientContext.Adapt(context )); Queue <AuthOption> options = new List <AuthOption>(); Lookup <AuthSchemeProvider> registry = clientContext.GetAuthSchemeRegistry(); if (registry == null) { this.log.Debug("Auth scheme registry not set in the context"); return(options); } CredentialsProvider credsProvider = clientContext.GetCredentialsProvider(); if (credsProvider == null) { this.log.Debug("Credentials provider not set in the context"); return(options); } RequestConfig config = clientContext.GetRequestConfig(); ICollection <string> authPrefs = GetPreferredAuthSchemes(config); if (authPrefs == null) { authPrefs = DefaultSchemePriority; } if (this.log.IsDebugEnabled()) { this.log.Debug("Authentication schemes in the order of preference: " + authPrefs); } foreach (string id in authPrefs) { Header challenge = challenges.Get(id.ToLower(CultureInfo.InvariantCulture)); if (challenge != null) { AuthSchemeProvider authSchemeProvider = registry.Lookup(id); if (authSchemeProvider == null) { if (this.log.IsWarnEnabled()) { this.log.Warn("Authentication scheme " + id + " not supported"); } // Try again continue; } AuthScheme authScheme = authSchemeProvider.Create(context); authScheme.ProcessChallenge(challenge); AuthScope authScope = new AuthScope(authhost.GetHostName(), authhost.GetPort(), authScheme .GetRealm(), authScheme.GetSchemeName()); Credentials credentials = credsProvider.GetCredentials(authScope); if (credentials != null) { options.AddItem(new AuthOption(authScheme, credentials)); } } else { if (this.log.IsDebugEnabled()) { this.log.Debug("Challenge for " + id + " authentication scheme not available"); } } } // Try again return(options); }
/// <summary> /// 设置认证信息参数 /// </summary> /// <param name="provider">认证信息提供对象</param> /// <returns>cloudauthClient 构造器</returns> public Builder CredentialsProvider(CredentialsProvider provider) { cloudauthClient.credentialsProvider = provider; return(this); }
protected BaseOnvifTest(TestLaunchParam param) : base(param) { _features.Mode = param.FeatureDefinitionMode; if (param.FeatureDefinitionMode == FeatureDefinitionMode.Default) { _features.AddRange(param.Features); } //_cameraAddress = param.ServiceAddress; FirmwareFilePath = param.FirmwareFilePath; CredentialIdentifierValueFirst = param.CredentialIdentifierValueFirst; CredentialIdentifierValueSecond = param.CredentialIdentifierValueSecond; CredentialIdentifierValueThird = param.CredentialIdentifierValueThird; _cameraIp = param.CameraIp; _cameraId = param.CameraUUID; _nic = param.NIC; TestTool.HttpTransport.RequestNetworkStream.EndpointFrom = new IPEndPoint(_nic.IP, 0); _username = param.UserName; _password = param.Password; _useUTCTimestamp = param.UseUTCTimestamp; Operator = param.Operator; if (param.VideoForm != null) { _videoForm = param.VideoForm; // reinitialize video window _videoForm.Reset(); _videoForm.NICIndex = param.NIC.Index; _videoForm.StopEvent = _semaphore.StopEvent; } _declaredScopes.AddRange(param.DeclaredScopes); _environmentSettings = param.EnvironmentSettings; _messageTimeout = param.MessageTimeout; _operationDelay = param.OperationDelay; _recoveryDelay = param.RecoveryDelay; _rebootTimeout = param.RebootTimeout; // should be done in BaseTest.Initialize(); //_trafficListener = new TrafficListener(); //_trafficListener.RequestSent += LogRequest; //_trafficListener.ResponseReceived += LogResponse; _endpointController = new EndpointController(new EndpointAddress(param.ServiceAddress)); _credentialsProvider = new CredentialsProvider { Username = param.UserName, Password = param.Password, Security = param.Security }; NetworkSettingsChangedEvent += address => { var uri = new EndpointAddress(address); var addresses = Dns.GetHostAddresses(uri.Uri.Host); IPAddress newAddr = null; switch (uri.Uri.HostNameType) { case UriHostNameType.IPv4: newAddr = addresses.FirstOrDefault(u => u.AddressFamily == AddressFamily.InterNetwork); break; case UriHostNameType.IPv6: newAddr = addresses.FirstOrDefault(u => u.AddressFamily == AddressFamily.InterNetworkV6); break; case UriHostNameType.Dns: newAddr = addresses.FirstOrDefault(u => u.AddressFamily == AddressFamily.InterNetwork); if (null == _cameraIp) { newAddr = addresses.FirstOrDefault(u => u.AddressFamily == AddressFamily.InterNetworkV6); } break; } if (null != newAddr) { _endpointController.UpdateAddress(uri); _cameraIp = newAddr; } }; }
/// <summary> /// 默认构造函数, /// 注意如果使用此方法 httpRequestConfig 使用的http 请求 schema 为Https /// </summary> /// <param name="credentialsProvider">认证信息</param> public CloudauthClient(CredentialsProvider credentialsProvider) { this.credentialsProvider = credentialsProvider; }
/// <summary> /// 设置认证信息 /// </summary> /// <param name="credentialsProvider">设置认证信息</param> public static void CredentialsProvider(CredentialsProvider credentialsProvider) { DefaultInstance._credentialsProvider = credentialsProvider; }
/// <summary> /// 默认构造函数 /// </summary> /// <param name="httpRequestConfig">http 客户端配置信息</param> /// <param name="credentialsProvider">认证信息</param> public KubernetesClient(CredentialsProvider credentialsProvider, HttpRequestConfig httpRequestConfig) { this.httpRequestConfig = httpRequestConfig; this.credentialsProvider = credentialsProvider; }
/// <summary> /// 默认构造函数, /// 注意如果使用此方法 httpRequestConfig 使用的http 请求 schema 为Https /// </summary> /// <param name="credentialsProvider">认证信息</param> public IothubClient(CredentialsProvider credentialsProvider) { this.credentialsProvider = credentialsProvider; }
/// <summary> /// 设置认证信息参数 /// </summary> /// <param name="provider">认证信息提供对象</param> /// <returns>kubernetesClient 构造器</returns> public Builder CredentialsProvider(CredentialsProvider provider) { kubernetesClient.credentialsProvider = provider; return(this); }
public RouteCalculator( CredentialsProvider credentialsProvider, Location to, Location from, Dispatcher uiDispatcher, Action<RouteResponse> routeFound) { if (credentialsProvider == null) { throw new ArgumentNullException("credentialsProvider"); } if (uiDispatcher == null) { throw new ArgumentNullException("uiDispatcher"); } if (routeFound == null) { throw new ArgumentNullException("routeFound"); } from_address = false; x_from = from; x_to = to; _credentialsProvider = credentialsProvider; _uiDispatcher = uiDispatcher; _routeFound = routeFound; _routeClient = new RouteServiceClient(); _routeClient.CalculateRouteCompleted += client_RouteCompleted; // Calculate the route. CalculateRoute(); }
/// <summary> /// 设置认证信息参数 /// </summary> /// <param name="provider">认证信息提供对象</param> /// <returns>containerregistryClient 构造器</returns> public Builder CredentialsProvider(CredentialsProvider provider) { containerregistryClient.credentialsProvider = provider; return(this); }
/// <summary> /// 默认构造函数, /// 注意如果使用此方法 httpRequestConfig 使用的http 请求 schema 为Https /// </summary> /// <param name="credentialsProvider">认证信息</param> public OrderClient(CredentialsProvider credentialsProvider) { this.credentialsProvider = credentialsProvider; }
/// <summary> /// 默认构造函数, /// 注意如果使用此方法 httpRequestConfig 使用的http 请求 schema 为Https /// </summary> /// <param name="credentialsProvider">认证信息</param> public PortalClient(CredentialsProvider credentialsProvider) { this.credentialsProvider = credentialsProvider; }
private void DiscoveryControllerSecurityChangedEvent(CredentialsProvider credentialsProvider) { _discoveryController.UpdateCredentials(credentialsProvider.Username, credentialsProvider.Password); }