Ejemplo n.º 1
0
        public AccessTokenSourceOptions(Uri tokenUri, OAuthOptions oauthOptions, string refreshToken)
        {
            if (tokenUri == null)
            {
                throw new ArgumentNullException(nameof(tokenUri));
            }
            if (oauthOptions == null)
            {
                throw new ArgumentNullException(nameof(oauthOptions));
            }

            TokenUri     = tokenUri;
            OAuthOptions = oauthOptions;
            RefreshToken = refreshToken;
        }
Ejemplo n.º 2
0
        private AccessTokenSource(Uri tokenUri, OAuthOptions oauthOptions, string refreshToken, string userAgent, HttpClientPool httpClientPool)
        {
            if (tokenUri == null)
            {
                throw new ArgumentNullException(nameof(tokenUri));
            }
            if (oauthOptions == null)
            {
                throw new ArgumentNullException(nameof(oauthOptions));
            }
            if (refreshToken == null)
            {
                throw new ArgumentNullException(nameof(refreshToken));
            }

            this.tokenUri       = tokenUri;
            this.oauthOptions   = oauthOptions;
            this.refreshToken   = refreshToken;
            this.userAgent      = userAgent ?? UserAgent.GenerateDefault();
            this.httpClientPool = httpClientPool ?? HttpClientPool.Default;
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Constructs an access token source from the given <paramref name="oauthOptions"/> and <paramref name="refreshToken"/>.
 /// </summary>
 public AccessTokenSource(OAuthOptions oauthOptions, string refreshToken)
     : this(new AccessTokenSourceOptions(oauthOptions, refreshToken))
 {
 }
Ejemplo n.º 4
0
 public AccessTokenSourceOptions(OAuthOptions oauthOptions, string refreshToken)
     : this(new Uri($"https://launchpad.37signals.com/authorization/token"), oauthOptions, refreshToken)
 {
 }