public NzbgetClient(IConfigService configService, IHttpProvider httpProvider, IParsingService parsingService, Logger logger) { _configService = configService; _httpProvider = httpProvider; _parsingService = parsingService; _logger = logger; }
public Task<ServiceInfo> GetServiceInfo( AppConfig appConfig, CredentialCache credentialCache, IHttpProvider httpProvider, ClientType clientType = ClientType.Consumer) { if (clientType == ClientType.Business) { throw new OneDriveException( new Error { Code = OneDriveErrorCode.AuthenticationFailure.ToString(), Message = "OnlineIdServiceProvider only supports Microsoft Account authentication." }); } var microsoftAccountServiceInfo = new MicrosoftAccountServiceInfo { AppId = appConfig.MicrosoftAccountAppId, ClientSecret = appConfig.MicrosoftAccountClientSecret, CredentialCache = credentialCache, HttpProvider = httpProvider, Scopes = appConfig.MicrosoftAccountScopes, }; microsoftAccountServiceInfo.AuthenticationProvider = this.AuthenticationProvider ?? new OnlineIdAuthenticationProvider(microsoftAccountServiceInfo); return Task.FromResult<ServiceInfo>(microsoftAccountServiceInfo); }
public static IOneDriveClient GetUniversalClient( string[] scopes, string returnUrl = null, IHttpProvider httpProvider = null) { return OneDriveClientExtensions.GetClientUsingOnlineIdAuthenticator(scopes, returnUrl, httpProvider); }
public async override Task<ServiceInfo> GetServiceInfo( AppConfig appConfig, CredentialCache credentialCache, IHttpProvider httpProvider, ClientType clientType = ClientType.Business) { if (clientType == ClientType.Consumer) { throw new OneDriveException( new Error { Code = OneDriveErrorCode.AuthenticationFailure.ToString(), Message = "AdalServiceInfoProvider only supports Active Directory authentication." }); } var serviceInfo = await base.GetServiceInfo(appConfig, credentialCache, httpProvider, clientType); serviceInfo.BaseUrl = appConfig.ActiveDirectoryServiceEndpointUrl; serviceInfo.ServiceResource = appConfig.ActiveDirectoryServiceResource; if (serviceInfo.AuthenticationProvider == null) { serviceInfo.AuthenticationProvider = new AdalAuthenticationProvider(serviceInfo); } return serviceInfo; }
public PneumaticClient(IConfigService configService, IHttpProvider httpProvider, IDiskProvider diskProvider) { _configService = configService; _httpProvider = httpProvider; _diskProvider = diskProvider; }
/// <summary> /// Instantiates a new OneDriveClient. /// </summary> /// <param name="baseUrl">The base service URL. For example, "https://api.onedrive.com/v1.0."</param> /// <param name="authenticationProvider">The <see cref="IAuthenticationProvider"/> for authenticating request messages.</param> /// <param name="httpProvider">The <see cref="IHttpProvider"/> for sending requests.</param> public OneDriveClient( string baseUrl, IAuthenticationProvider authenticationProvider, IHttpProvider httpProvider = null) : base(baseUrl, authenticationProvider, httpProvider) { }
public async override Task<ServiceInfo> GetServiceInfo( AppConfig appConfig, CredentialCache credentialCache, IHttpProvider httpProvider, ClientType clientType = ClientType.Business) { if (clientType == ClientType.Consumer) { throw new OneDriveException( new Error { Code = OneDriveErrorCode.AuthenticationFailure.ToString(), Message = "AdalServiceInfoProvider only supports Active Directory authentication." }); } var serviceInfo = await base.GetServiceInfo(appConfig, null, httpProvider, clientType); serviceInfo.ServiceResource = appConfig.ActiveDirectoryServiceResource; if (string.IsNullOrEmpty(serviceInfo.BaseUrl) && !string.IsNullOrEmpty(serviceInfo.ServiceResource)) { serviceInfo.BaseUrl = string.Format( Constants.Authentication.OneDriveBusinessBaseUrlFormatString, serviceInfo.ServiceResource.TrimEnd('/'), "v2.0"); } if (serviceInfo.AuthenticationProvider == null) { serviceInfo.AuthenticationProvider = new AdalAuthenticationProvider(serviceInfo); } return serviceInfo; }
/// <summary> /// Generates the <see cref="ServiceInfo"/> for the current application configuration. /// </summary> /// <param name="appConfig">The <see cref="AppConfig"/> for the current application.</param> /// <param name="credentialCache">The cache instance for storing user credentials.</param> /// <param name="httpProvider">The <see cref="IHttpProvider"/> for sending HTTP requests.</param> /// <param name="clientType">The <see cref="ClientType"/> to specify the business or consumer service.</param> /// <returns>The <see cref="ServiceInfo"/> for the current session.</returns> public virtual Task<ServiceInfo> GetServiceInfo( AppConfig appConfig, CredentialCache credentialCache, IHttpProvider httpProvider, ClientType clientType) { if (clientType == ClientType.Consumer) { var microsoftAccountServiceInfo = new MicrosoftAccountServiceInfo { AppId = appConfig.MicrosoftAccountAppId, ClientSecret = appConfig.MicrosoftAccountClientSecret, CredentialCache = credentialCache, HttpProvider = httpProvider, ReturnUrl = appConfig.MicrosoftAccountReturnUrl, Scopes = appConfig.MicrosoftAccountScopes, WebAuthenticationUi = this.webAuthenticationUi, }; microsoftAccountServiceInfo.AuthenticationProvider = this.AuthenticationProvider?? new MicrosoftAccountAuthenticationProvider(microsoftAccountServiceInfo); return Task.FromResult<ServiceInfo>(microsoftAccountServiceInfo); } var activeDirectoryServiceInfo = new ActiveDirectoryServiceInfo { AppId = appConfig.ActiveDirectoryAppId, AuthenticationProvider = this.AuthenticationProvider, ClientSecret = appConfig.ActiveDirectoryClientSecret, CredentialCache = credentialCache, HttpProvider = httpProvider, ReturnUrl = appConfig.ActiveDirectoryReturnUrl, }; return Task.FromResult<ServiceInfo>(activeDirectoryServiceInfo); }
/// <summary> /// Instantiates a new OneDriveClient. /// </summary> public OneDriveClient( AppConfig appConfig, CredentialCache credentialCache = null, IHttpProvider httpProvider = null, IServiceInfoProvider serviceInfoProvider = null) : base(appConfig, credentialCache, httpProvider, serviceInfoProvider) { }
/// <summary> /// Instantiates a new OneDriveClient. /// </summary> public OneDriveClient( AppConfig appConfig, CredentialCache credentialCache = null, IHttpProvider httpProvider = null, IServiceInfoProvider serviceInfoProvider = null, ClientType clientType = ClientType.Consumer) : base(appConfig, credentialCache, httpProvider, serviceInfoProvider, clientType) { }
/// <summary> /// Creates an authenticated client that uses the WebAuthenticationBroker API in SSO mode for authentication. /// </summary> /// <param name="appId">The application ID for Microsoft account authentication.</param> /// <param name="scopes">The requested scopes for Microsoft account authentication.</param> /// <param name="httpProvider">The <see cref="IHttpProvider"/> for sending HTTP requests.</param> /// <returns>The <see cref="IOneDriveClient"/> for the session.</returns> public static Task<IOneDriveClient> GetAuthenticatedClientUsingWebAuthenticationBroker( string appId, string[] scopes, IHttpProvider httpProvider = null) { return OneDriveClientExtensions.GetAuthenticatedClientUsingWebAuthenticationBroker( appId, /* returnUrl */ null, scopes, httpProvider); }
public static IOneDriveClient GetClientUsingOnlineIdAuthenticator( string[] scopes, string returnUrl = null, IHttpProvider httpProvider = null) { return new OneDriveClient( new AppConfig { MicrosoftAccountScopes = scopes }, /* credentialCache */ null, httpProvider ?? new HttpProvider(), new OnlineIdServiceInfoProvider()); }
public static IOneDriveClient GetClientUsingWebAuthenticationBroker( string appId, string[] scopes, string returnUrl = null, IHttpProvider httpProvider = null) { return new OneDriveClient( new AppConfig { MicrosoftAccountScopes = scopes }, /* credentialCache */ null, httpProvider ?? new HttpProvider(new Serializer()), new WebAuthenticationBrokerServiceInfoProvider()); }
public SabnzbdClient(IConfigService configService, IHttpProvider httpProvider, ICacheManger cacheManger, IParsingService parsingService, Logger logger) { _configService = configService; _httpProvider = httpProvider; _parsingService = parsingService; _queueCache = cacheManger.GetCache<IEnumerable<QueueItem>>(GetType(), "queue"); _logger = logger; }
public NzbImportProvider(IDiskProvider disk, IHttpProvider http, IDecompressProvider decompress, INzbParseProvider parse, INzbQueueProvider queue, INntpProvider nntp, IPreQueueProvider preQueue, IConfigProvider config) { _disk = disk; _http = http; _decompress = decompress; _parse = parse; _queue = queue; _list = new List<NzbImportModel>(); _nntp = nntp; _preQueue = preQueue; _config = config; }
/// <summary> /// Creates an authenticated client that uses the OnlineIdAuthenticator API for authentication. /// </summary> /// <param name="scopes">The requested scopes for Microsoft account authentication.</param> /// <param name="httpProvider">The <see cref="IHttpProvider"/> for sending HTTP requests.</param> /// <returns>The <see cref="IOneDriveClient"/> for the session.</returns> public static async Task<IOneDriveClient> GetAuthenticatedClientUsingOnlineIdAuthenticator( string[] scopes, IHttpProvider httpProvider = null) { var client = OneDriveClientExtensions.GetClientUsingOnlineIdAuthenticator( scopes, httpProvider: httpProvider); await client.AuthenticateAsync(); return client; }
public override async Task<ServiceInfo> GetServiceInfo( AppConfig appConfig, CredentialCache credentialCache, IHttpProvider httpProvider, ClientType clientType) { var serviceInfo = await base.GetServiceInfo(appConfig, credentialCache, httpProvider, clientType); var authProvider = new IosAuthenticationProvider(serviceInfo); serviceInfo.AuthenticationProvider = authProvider; return serviceInfo; }
public override async Task<ServiceInfo> GetServiceInfo(AppConfig appConfig, CredentialCache credentialCache, IHttpProvider httpProvider) { ServiceInfo serviceInfo = await base.GetServiceInfo(appConfig, credentialCache, httpProvider); if (credentialCache.cacheDictionary.Count > 0) { var credentialPair = credentialCache.cacheDictionary.First(); serviceInfo.UserId = credentialPair.Key.UserId; } return serviceInfo; }
/// <summary> /// Constructs a new <see cref="BaseClient"/>. /// </summary> public BaseClient( AppConfig appConfig, CredentialCache credentialCache = null, IHttpProvider httpProvider = null, IServiceInfoProvider serviceInfoProvider = null) { this.appConfig = appConfig; this.credentialCache = credentialCache ?? new CredentialCache(); this.HttpProvider = httpProvider ?? new HttpProvider(new Serializer()); this.serviceInfoProvider = serviceInfoProvider ?? new ServiceInfoProvider(); }
/// <summary> /// Constructs a new <see cref="BaseClient"/>. /// </summary> public BaseClient( AppConfig appConfig, CredentialCache credentialCache = null, IHttpProvider httpProvider = null, IServiceInfoProvider serviceInfoProvider = null, ClientType clientType = ClientType.Consumer) { this.appConfig = appConfig; this.ClientType = clientType; this.credentialCache = credentialCache; this.HttpProvider = httpProvider ?? new HttpProvider(new Serializer()); this.serviceInfoProvider = serviceInfoProvider ?? new ServiceInfoProvider(); }
public Task<ServiceInfo> GetServiceInfo(AppConfig appConfig, CredentialCache credentialCache, IHttpProvider httpProvider) { var microsoftAccountServiceInfo = new MicrosoftAccountServiceInfo { AppId = appConfig.MicrosoftAccountAppId, ClientSecret = appConfig.MicrosoftAccountClientSecret, CredentialCache = credentialCache, HttpProvider = httpProvider, Scopes = appConfig.MicrosoftAccountScopes, }; microsoftAccountServiceInfo.AuthenticationProvider = this.AuthenticationProvider ?? new OnlineIdAuthenticationProvider(microsoftAccountServiceInfo); return Task.FromResult<ServiceInfo>(microsoftAccountServiceInfo); }
/// <summary> /// Creates an authenticated OneDrive client for use against OneDrive consumer. /// </summary> /// <param name="appId">The application ID for Microsoft account authentication.</param> /// <param name="returnUrl">The application return URL for Microsoft account authentication.</param> /// <param name="scopes">The requested scopes for Microsoft account authentication.</param> /// <param name="credentialCache">The cache instance for storing user credentials.</param> /// <param name="httpProvider">The <see cref="IHttpProvider"/> for sending HTTP requests.</param> /// <returns>The <see cref="IOneDriveClient"/> for the session.</returns> public static Task<IOneDriveClient> GetAuthenticatedMicrosoftAccountClient( string appId, string returnUrl, string[] scopes, CredentialCache credentialCache = null, IHttpProvider httpProvider = null) { return OneDriveClient.GetAuthenticatedMicrosoftAccountClient( appId, returnUrl, scopes, /* clientSecret */ null, new ServiceInfoProvider(), credentialCache, httpProvider); }
public Task<ServiceInfo> GetServiceInfo(AppConfig appConfig, CredentialCache credentialCache, IHttpProvider httpProvider) { var microsoftAccountServiceInfo = new MicrosoftAccountServiceInfo { AppId = appConfig.MicrosoftAccountAppId, ClientSecret = appConfig.MicrosoftAccountClientSecret, CredentialCache = credentialCache, HttpProvider = httpProvider, ReturnUrl = WebAuthenticationBroker.GetCurrentApplicationCallbackUri().ToString(), Scopes = appConfig.MicrosoftAccountScopes, WebAuthenticationUi = this.webAuthenticationUi, }; microsoftAccountServiceInfo.AuthenticationProvider = this.AuthenticationProvider ?? new WebAuthenticationBrokerAuthenticationProvider(microsoftAccountServiceInfo); return Task.FromResult<ServiceInfo>(microsoftAccountServiceInfo); }
/// <summary> /// Creates an authenticated client that uses the WebAuthenticationBroker API in non-SSO mode for authentication. /// </summary> /// <param name="appId">The application ID for Microsoft account authentication.</param> /// <param name="returnUrl">The application return URL for Microsoft account authentication.</param> /// <param name="scopes">The requested scopes for Microsoft account authentication.</param> /// <param name="httpProvider">The <see cref="IHttpProvider"/> for sending HTTP requests.</param> /// <returns>The <see cref="IOneDriveClient"/> for the session.</returns> public static async Task<IOneDriveClient> GetAuthenticatedClientUsingWebAuthenticationBroker( string appId, string returnUrl, string[] scopes, IHttpProvider httpProvider = null) { var client = OneDriveClientExtensions.GetClientUsingWebAuthenticationBroker( appId, returnUrl, scopes, httpProvider); await client.AuthenticateAsync(); return client; }
/// <summary> /// Creates a OneDrive client for use against OneDrive consumer. /// </summary> /// <param name="appId">The application ID for Microsoft Account authentication.</param> /// <param name="returnUrl">The application return URL for Microsoft Account authentication.</param> /// <param name="scopes">The requested scopes for Microsoft Account authentication.</param> /// <param name="credentialCache">The cache instance for storing user credentials.</param> /// <param name="httpProvider">The <see cref="IHttpProvider"/> for sending HTTP requests.</param> /// <param name="webAuthenticationUi">The <see cref="IWebAuthenticationUi"/> for displaying authentication UI to the user.</param> /// <returns>The <see cref="IOneDriveClient"/> for the session.</returns> public static IOneDriveClient GetMicrosoftAccountClient( string appId, string returnUrl, string[] scopes, CredentialCache credentialCache = null, IHttpProvider httpProvider = null, IWebAuthenticationUi webAuthenticationUi = null) { return OneDriveClient.GetMicrosoftAccountClient( appId, returnUrl, scopes, /* clientSecret */ null, credentialCache, httpProvider, new ServiceInfoProvider(webAuthenticationUi)); }
/// <summary> /// Creates a OneDrive client for use against OneDrive consumer. /// </summary> /// <param name="appId">The application ID for Microsoft Account authentication.</param> /// <param name="returnUrl">The application return URL for Microsoft Account authentication.</param> /// <param name="scopes">The requested scopes for Microsoft Account authentication.</param> /// <param name="clientSecret">The client secret for Microsoft Account authentication.</param> /// <param name="credentialCache">The cache instance for storing user credentials.</param> /// <param name="httpProvider">The <see cref="IHttpProvider"/> for sending HTTP requests.</param> /// <param name="serviceInfoProvider">The <see cref="IServiceInfoProvider"/> for initializing the <see cref="IServiceInfo"/> for the session.</param> /// <returns>The <see cref="IOneDriveClient"/> for the session.</returns> public static IOneDriveClient GetMicrosoftAccountClient( string appId, string returnUrl, string[] scopes, string clientSecret, CredentialCache credentialCache = null, IHttpProvider httpProvider = null, IServiceInfoProvider serviceInfoProvider = null) { var appConfig = new AppConfig { MicrosoftAccountAppId = appId, MicrosoftAccountReturnUrl = returnUrl, MicrosoftAccountScopes = scopes, }; return new OneDriveClient(appConfig, credentialCache, httpProvider, serviceInfoProvider); }
public static async Task<IOneDriveClient> GetAuthenticatedActiveDirectoryClient( string appId, string returnUrl = null, string serviceResource = null, string serviceEndpointUrl = null, AdalCredentialCache credentialCache = null, IHttpProvider httpProvider = null) { var client = BusinessClientExtensions.GetActiveDirectoryClient( appId, returnUrl, serviceResource, serviceEndpointUrl, credentialCache, httpProvider); await client.AuthenticateAsync(); return client; }
public static IOneDriveClient GetActiveDirectoryClient( string appId, string returnUrl, string serviceResource = null, string serviceEndpointUrl = null, AdalCredentialCache credentialCache = null, IHttpProvider httpProvider = null) { return BusinessClientExtensions.GetClientInternal( new BusinessAppConfig { ActiveDirectoryAppId = appId, ActiveDirectoryReturnUrl = returnUrl, ActiveDirectoryServiceEndpointUrl = serviceEndpointUrl, ActiveDirectoryServiceResource = serviceResource, }, /* serviceInfoProvider */ null, credentialCache, httpProvider); }
public static IOneDriveClient GetActiveDirectoryClient( string appId, string returnUrl = null, string serviceResource = null, string serviceEndpointUrl = null, AdalCredentialCache credentialCache = null, IHttpProvider httpProvider = null) { return new OneDriveClient( new AppConfig { ActiveDirectoryAppId = appId, ActiveDirectoryReturnUrl = returnUrl, ActiveDirectoryServiceEndpointUrl = serviceEndpointUrl, ActiveDirectoryServiceResource = serviceResource, }, credentialCache ?? new AdalCredentialCache(), new HttpProvider(), new AdalServiceInfoProvider(), ClientType.Business); }
public PlexService(IHttpProvider httpProvider, IPlexServerProxy plexServerProxy, Logger logger) { _httpProvider = httpProvider; _plexServerProxy = plexServerProxy; _logger = logger; }
/// <summary> /// Initializes a new instance of the <see cref="CarrierServicesConnector"/> class. /// </summary> /// <param name="httpProvider">The HTTP provider.</param> public CarrierServicesConnector(IHttpProvider httpProvider) : base(httpProvider) { }
public FetchFeedService(IHttpProvider httpProvider, Logger logger) { _httpProvider = httpProvider; _logger = logger; }
/// <summary> /// Instantiates a new OneDriveClient. /// </summary> /// <param name="authenticationProvider">The <see cref="IAuthenticationProvider"/> for authenticating request messages.</param> /// <param name="httpProvider">The <see cref="IHttpProvider"/> for sending requests.</param> public OneDriveClient( IAuthenticationProvider authenticationProvider, IHttpProvider httpProvider = null) : this("https://api.onedrive.com/v1.0", authenticationProvider, httpProvider) { }
protected MetadataBase(IDiskProvider diskProvider, IHttpProvider httpProvider, Logger logger) { _diskProvider = diskProvider; _httpProvider = httpProvider; _logger = logger; }
public TorrentDetailProvider(IHttpProvider httpProvider, ITorrentDetailTransformer torrentDetailTransformer) { _httpProvider = httpProvider; _torrentDetailTransformer = torrentDetailTransformer; }
/// <summary> /// Initializes a new instance of the <see cref="SipIpAccessControlListsConnector"/> class. /// </summary> /// <param name="httpProvider">The HTTP provider.</param> public SipIpAccessControlListsConnector(IHttpProvider httpProvider) : base(httpProvider) { }
/// <summary> /// Initializes a new instance of the <see cref="FraudControlConnector"/> class. /// </summary> /// <param name="httpProvider">The HTTP provider.</param> public FraudControlConnector(IHttpProvider httpProvider) : base(httpProvider) { }
public Task <ServiceInfo> GetServiceInfo(AppConfig appConfig, CredentialCache credentialCache, IHttpProvider httpProvider) { var microsoftAccountServiceInfo = new MicrosoftAccountServiceInfo { AppId = appConfig.MicrosoftAccountAppId, ClientSecret = appConfig.MicrosoftAccountClientSecret, CredentialCache = credentialCache, HttpProvider = httpProvider, ReturnUrl = WebAuthenticationBroker.GetCurrentApplicationCallbackUri().ToString(), Scopes = appConfig.MicrosoftAccountScopes, WebAuthenticationUi = this.webAuthenticationUi, }; microsoftAccountServiceInfo.AuthenticationProvider = this.AuthenticationProvider ?? new WebAuthenticationBrokerAuthenticationProvider(microsoftAccountServiceInfo); return(Task.FromResult <ServiceInfo>(microsoftAccountServiceInfo)); }
public NotificationsController(IHttpProvider httpProvider) { this.httpProvider = httpProvider ?? throw new ArgumentNullException(nameof(httpProvider)); }
/// <summary> /// Instantiates a new GraphServiceClient. /// </summary> /// <param name="authenticationProvider">The <see cref="IAuthenticationProvider"/> for authenticating request messages.</param> /// <param name="httpProvider">The <see cref="IHttpProvider"/> for sending requests.</param> public GraphServiceClient( IAuthenticationProvider authenticationProvider, IHttpProvider httpProvider = null) : this("https://graph.microsoft.com/v1.0", authenticationProvider, httpProvider) { }
public JsonApiProvider(IHttpProvider httpProvider, Logger logger) { _httpProvider = httpProvider; _logger = logger; }
public BaseClient(string serverName, IAuthenticationProvider authenticationProvider, IHttpProvider httpProvider = null) { this.BaseUrl = string.Format(TEAM_SUPPORT_BASE_API_FORMAT, serverName); this.AuthenticationProvider = authenticationProvider; this.HttpProvider = httpProvider ?? new DefaultHttpProvider(); }
/// <summary> /// Constructor of a Single User Public client application (i.e. for Desktop/Mobile) targetting a specific URL of Microsoft Graph /// </summary> /// <param name="baseUrl">The base service URL for Microsoft Graph. For example, "https://graph.microsoft.com/v1.0".</param> /// <param name="authenticationProvider">The authentication provider</param> /// <param name="httpProvider">An optional Http Provider</param> private SingleUserPublicClientGraphApplication(string baseUrl, SingleUserPublicClientApplicationAuthenticationProvider authenticationProvider, IHttpProvider httpProvider) : base(baseUrl, authenticationProvider, httpProvider) { this.authenticationProvider = authenticationProvider; }
public GraphPaginationEnumerator(IHttpProvider httpProvider, string entityEndpoint, int pageSize = 10) { HttpProvider = httpProvider; EntityEndpoint = entityEndpoint; PageSize = pageSize; }
public HttpApiProvider(IHttpProvider httpProvider, Logger logger) { _httpProvider = httpProvider; _logger = logger; }
public CoverAlreadyExistsSpecification(IDiskProvider diskProvider, IHttpProvider httpProvider, Logger logger) { _diskProvider = diskProvider; _httpProvider = httpProvider; _logger = logger; }