/// <summary> /// Initializes a new instance of the <see cref="GoogleDriveSupportFactory"/> class. /// </summary> /// <param name="oAuth2Client">The OAuth2 client to be used to get the authentication token</param> /// <param name="restClientCreateFunc">A delegate to create a new <see cref="IRestClient"/></param> /// <param name="createTempDataFunc">A delegate to create a temporary storage</param> public GoogleDriveSupportFactory([NotNull] OAuth2Client oAuth2Client, [NotNull] Func<IRestClient> restClientCreateFunc, [NotNull] Func<ITemporaryData> createTempDataFunc) { _createTempDataFunc = createTempDataFunc; _restClientCreateFunc = restClientCreateFunc; _oAuth2Client = oAuth2Client; _authenticator = new OAuth2AuthorizationRequestHeaderAuthenticator(oAuth2Client); }
/// <summary> /// Initializes a new instance of the <see cref="OAuth2Authenticator"/> class. /// </summary> /// <param name="client">The OAuth2 client</param> protected OAuth2Authenticator(OAuth2.OAuth2Client client) { Client = client; }
/// <summary> /// Initializes a new instance of the <see cref="OAuth2AuthorizationRequestHeaderAuthenticator"/> class. /// </summary> /// <param name="client">The OAuth2 client</param> /// <param name="tokenType"> /// The token type. /// </param> public OAuth2AuthorizationRequestHeaderAuthenticator(OAuth2.OAuth2Client client, string tokenType) : base(client) { _tokenType = tokenType; }
/// <summary> /// Initializes a new instance of the <see cref="OAuth2AuthorizationRequestHeaderAuthenticator"/> class. /// </summary> /// <param name="client">The OAuth2 client</param> public OAuth2AuthorizationRequestHeaderAuthenticator(OAuth2.OAuth2Client client) : this(client, (string.IsNullOrEmpty(client.TokenType) ? "OAuth" : client.TokenType)) { }
/// <summary> /// Initializes a new instance of the <see cref="OAuth2UriQueryParameterAuthenticator"/> class. /// </summary> /// <param name="client">The OAuth2 client</param> public OAuth2UriQueryParameterAuthenticator(OAuth2.OAuth2Client client) : base(client) { }
/// <summary> /// Initializes a new instance of the <see cref="OAuth2Authenticator"/> class. /// </summary> /// <param name="client">The OAuth2 client</param> /// <param name="challengeTimespan">The time span that has to be exceeded before a new challenge can be handled</param> protected OAuth2Authenticator(OAuth2.OAuth2Client client, TimeSpan challengeTimespan) { Client = client; ChallengeTimespan = challengeTimespan; }
/// <summary> /// Initializes a new instance of the <see cref="OAuth2Authenticator"/> class. /// </summary> /// <param name="client">The OAuth2 client</param> protected OAuth2Authenticator(OAuth2.OAuth2Client client) : this(client, TimeSpan.FromSeconds(60)) { }