Ejemplo n.º 1
0
        /// <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;
        }
Ejemplo n.º 2
0
 /// <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)
 {
 }
Ejemplo n.º 3
0
 /// <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();
 }
Ejemplo n.º 4
0
 /// <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)
 {
 }
Ejemplo n.º 5
0
 /// <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();
 }