/// <summary>
        /// Sends an HTTP request to the inner handler to send to the server as an asynchronous operation.
        /// </summary>
        /// <param name="request">The HTTP request message to send to the server.</param>
        /// <param name="cancellationToken">A cancellation token to cancel operation.</param>
        /// <returns>
        /// Returns <see cref="T:System.Threading.Tasks.Task`1" />. The task object representing the asynchronous operation.
        /// </returns>
        protected override Task <HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
        {
            if (request == null)
            {
                throw new ArgumentNullException("request");
            }

            try
            {
                var principal = SignatureValidator.Validate(request, this.SharedSecretResolver, this.MaximumMessageAge);

                if (this.ClaimsAuthenticationManager != null)
                {
                    principal = this.ClaimsAuthenticationManager.Authenticate(request.RequestUri.ToString(), principal);
                }

                this.SetPrincipal(principal);
            }
            catch (UnauthorizedException)
            {
                return(Unauthorized());
            }
            catch (ForbiddenException fbex)
            {
                return(Forbidden(fbex.Message));
            }
            catch (PreconditionFailedException pcex)
            {
                return(PreconditionFailed(pcex.Message));
            }

            return(base.SendAsync(request, cancellationToken));
        }