/// <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);
 }
Beispiel #2
0
 /// <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;
 }
Beispiel #3
0
 /// <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;
 }
Beispiel #4
0
 /// <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))
 {
 }
Beispiel #5
0
 /// <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))
 {
 }