/// <summary> /// Constructs a new instance using the specified <see cref="OAuth2Settings"/>. /// </summary> /// <param name="settings">An <see cref="OAuth2Settings"/> instance containing details used to request and manage tokens and authentication flows.</param> /// <param name="innerHandler">The inner <see cref="System.Net.Http.HttpMessageHandler"/> to call in the pipeline.</param> /// <param name="requestCondition">An optional <see cref="IRequestCondition"/> used to determine if authorisation is required. If null, then authorisation is always performed.</param> /// <exception cref="System.ArgumentNullException">Thrown if the <paramref name="settings"/> is null.</exception> /// <exception cref="System.InvalidOperationException">Thrown if a validation error occurs for the <paramref name="settings"/> argument. See <see cref="OAuth2Settings.Validate"/>.</exception> public OAuth2RequestSigningHandler(OAuth2Settings settings, System.Net.Http.HttpMessageHandler innerHandler, IRequestCondition requestCondition) : base(innerHandler) { if (settings == null) { throw new ArgumentNullException(nameof(settings)); } settings.Validate(); _Token = settings.AccessToken; _RequestCondition = requestCondition; _Settings = settings; }
/// <summary> /// Constructs a new instance using the specified <see cref="OAuth2Settings"/>. /// </summary> /// <param name="settings">An <see cref="OAuth2Settings"/> instance containing details used to request and manage tokens and authentication flows.</param> /// <param name="innerHandler">The inner <see cref="System.Net.Http.HttpMessageHandler"/> to call in the pipeline.</param> /// <exception cref="System.ArgumentNullException">Thrown if the <paramref name="settings"/> is null.</exception> public OAuth2RequestSigningHandler(OAuth2Settings settings, System.Net.Http.HttpMessageHandler innerHandler) : this(settings, innerHandler, null) { }
/// <summary> /// Constructs a new instance using the specified <see cref="OAuth2Settings"/>. /// </summary> /// <param name="settings">An <see cref="OAuth2Settings"/> instance containing details used to request and manage tokens and authentication flows.</param> /// <param name="innerHandler">The inner <see cref="System.Net.Http.HttpMessageHandler"/> to call in the pipeline.</param> /// <param name="requestCondition">An optional <see cref="IRequestCondition"/> used to determine if authorisation is required. If null, then authorisation is always performed.</param> /// <exception cref="System.ArgumentNullException">Thrown if the <paramref name="settings"/> is null.</exception> public OAuth2RequestSigningHandler(OAuth2Settings settings, System.Net.Http.HttpMessageHandler innerHandler, IRequestCondition requestCondition) : base(innerHandler) { Helper.Throw(); }
/// <summary> /// Constructs a new instance using the specified <see cref="OAuth2Settings"/>. /// </summary> /// <param name="settings">An <see cref="OAuth2Settings"/> instance containing details used to request and manage tokens and authentication flows.</param> /// <exception cref="System.ArgumentNullException">Thrown if the <paramref name="settings"/> is null.</exception> public OAuth2RequestSigningHandler(OAuth2Settings settings) : this(settings, CreateDefaultInnerHandler(), null) { }
/// <summary> /// Constructs a new instance using the specified <see cref="OAuth2Settings"/>. /// </summary> /// <param name="settings">An <see cref="OAuth2Settings"/> instance containing details used to request and manage tokens and authentication flows.</param> /// <exception cref="System.ArgumentNullException">Thrown if the <paramref name="settings"/> is null.</exception> public OAuth2RequestSigningHandler(OAuth2Settings settings) : this(settings, null, null) { Helper.Throw(); }