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; }
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; }
/// <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)) { }
public AccessTokenSourceOptions(OAuthOptions oauthOptions, string refreshToken) : this(new Uri($"https://launchpad.37signals.com/authorization/token"), oauthOptions, refreshToken) { }