public ClientAuthorizationProvider(IAsyncHttpClient httpClient, string Id, string secret) { if (httpClient == null) { throw new ArgumentNullException(nameof(httpClient)); } if (Id == null) { throw new ArgumentNullException(nameof(Id)); } if (secret == null) { throw new ArgumentNullException(nameof(secret)); } var request = new TokenRequest { ClientId = Id, ClientSecret = secret, GrantType = vGrantType }; Uri tokenUri = httpClient.CreateRequestUri(vTokenEndpoint); var response = httpClient.PostAsync <TokenRequest, Token>(tokenUri, request).Result; Token = response.AccessToken; }
public ConnectionManager(ILogger logger, ICredentialProvider credentialProvider, INetworkConnection networkConnectivity, IServerLocator serverDiscovery, string applicationName, string applicationVersion, IDevice device, ClientCapabilities clientCapabilities, ICryptographyProvider cryptographyProvider, Func <IClientWebSocket> webSocketFactory = null, ILocalAssetManager localAssetManager = null) { _credentialProvider = credentialProvider; _networkConnectivity = networkConnectivity; _logger = logger; _serverDiscovery = serverDiscovery; _httpClient = AsyncHttpClientFactory.Create(logger); ClientCapabilities = clientCapabilities; _webSocketFactory = webSocketFactory; _cryptographyProvider = cryptographyProvider; _localAssetManager = localAssetManager; Device = device; ApplicationVersion = applicationVersion; ApplicationName = applicationName; ApiClients = new Dictionary <string, IApiClient>(StringComparer.OrdinalIgnoreCase); SaveLocalCredentials = true; Device.ResumeFromSleep += Device_ResumeFromSleep; var jsonSerializer = new NewtonsoftJsonSerializer(); _connectService = new ConnectService(jsonSerializer, _logger, _httpClient, _cryptographyProvider, applicationName, applicationVersion); }
public ConnectionManager(ILogger logger, ICredentialProvider credentialProvider, INetworkConnection networkConnectivity, IServerLocator serverDiscovery, string applicationName, string applicationVersion, IDevice device, ClientCapabilities clientCapabilities, ICryptographyProvider cryptographyProvider, Func<IClientWebSocket> webSocketFactory = null, ILocalAssetManager localAssetManager = null) { _credentialProvider = credentialProvider; _networkConnectivity = networkConnectivity; _logger = logger; _serverDiscovery = serverDiscovery; _httpClient = AsyncHttpClientFactory.Create(logger); ClientCapabilities = clientCapabilities; _webSocketFactory = webSocketFactory; _cryptographyProvider = cryptographyProvider; _localAssetManager = localAssetManager; Device = device; ApplicationVersion = applicationVersion; ApplicationName = applicationName; ApiClients = new Dictionary<string, IApiClient>(StringComparer.OrdinalIgnoreCase); SaveLocalCredentials = true; Device.ResumeFromSleep += Device_ResumeFromSleep; var jsonSerializer = new NewtonsoftJsonSerializer(); _connectService = new ConnectService(jsonSerializer, _logger, _httpClient, _cryptographyProvider, applicationName, applicationVersion); }
private RepositoryFactory(IAsyncHttpClient authorizedHttpClient) { if (authorizedHttpClient==null) throw new ArgumentNullException(nameof(authorizedHttpClient)); if (!authorizedHttpClient.IsAuthorized) throw new ArgumentException(nameof(authorizedHttpClient) + $" is not authorized."); vClient = authorizedHttpClient; }
public HomeController( ILogger <HomeController> logger, IAsyncHttpClient httpClient, IAuthService authService) { this.logger = logger; this.httpClient = httpClient; this.authService = authService; }
public ConnectService(IJsonSerializer jsonSerializer, ILogger logger, IAsyncHttpClient httpClient, ICryptographyProvider cryptographyProvider, string appName, string appVersion) { JsonSerializer = jsonSerializer; _logger = logger; _httpClient = httpClient; _cryptographyProvider = cryptographyProvider; _appName = appName; _appVersion = appVersion; }
public SeederController( UserManager <LangMateUser> userManager, RoleManager <LangMateRole> roleManager, IAsyncHttpClient httpClient, ILanguagesService languagesService, IAuthService authService) { this.userManager = userManager; this.roleManager = roleManager; this.httpClient = httpClient; this.languagesService = languagesService; this.authService = authService; }
protected BaseClient(ICryptographyProvider cryptographyProvider, IJsonSerializer jsonSerializer, IAsyncHttpClient httpClient, ILogger <T> logger) { CryptographyProvider = cryptographyProvider; JsonSerializer = jsonSerializer; HttpClient = httpClient; Logger = logger; ClientName = Constants.AppName; ApplicationVersion = "1.0.0"; Device = new Device { DeviceId = Constants.DeviceId, DeviceName = Constants.DeviceName }; ResetHttpHeaders(); }
public ConnectionManager(ILogger logger, ICredentialProvider credentialProvider, INetworkConnection networkConnectivity, IServerLocator serverDiscovery, string applicationName, string applicationVersion, IDevice device, ClientCapabilities clientCapabilities, Func <IClientWebSocket> webSocketFactory = null) { _credentialProvider = credentialProvider; _networkConnectivity = networkConnectivity; _logger = logger; _serverDiscovery = serverDiscovery; _httpClient = AsyncHttpClientFactory.Create(logger); ClientCapabilities = clientCapabilities; _webSocketFactory = webSocketFactory; Device = device; ApplicationVersion = applicationVersion; ApplicationName = applicationName; ApiClients = new Dictionary <string, IApiClient>(StringComparer.OrdinalIgnoreCase); SaveLocalCredentials = true; }
protected BaseLocalPlayer(INetworkConnection network, IAsyncHttpClient httpClient) { Network = network; HttpClient = httpClient; network.NetworkChanged += network_NetworkChanged; }
public PortablePlayer(INetworkConnection network, IAsyncHttpClient httpClient) : base(network, httpClient) { }
internal BaseRepository(IAsyncHttpClient authorizedHttpClient, string endpoint) { vHttpClient = authorizedHttpClient ?? throw new ArgumentNullException(nameof(authorizedHttpClient)); vEndpoint = endpoint ?? throw new ArgumentNullException(nameof(endpoint)); }
public UsersProvider(IAsyncHttpClient client, BSIdentityManager bsIdentityManager) { _client = client; _bsIdentityManager = bsIdentityManager; }
public LocalPlayer(INetworkConnection network, IAsyncHttpClient httpClient) : base(network, httpClient) { }
public EmbyClient(ICryptographyProvider cryptographyProvider, IJsonSerializer jsonSerializer, IAsyncHttpClient httpClient, ILogger <EmbyClient> logger) : base(cryptographyProvider, jsonSerializer, httpClient, logger) { }
internal CommentRepository(IAsyncHttpClient authorizedHttpClient, string endpoint) : base(authorizedHttpClient, endpoint) { }
public RolesService(IUnitOfWork unitOfWork, IAsyncHttpClient httpClient, IUsersService userService) { _unitOfWork = unitOfWork; _httpClient = httpClient; _userService = userService; }