/// <summary>
        /// Retrieves the value of a claim.
        /// </summary>
        /// <param name="identity">The identity.</param>
        /// <param name="claimType">Type of the claim.</param>
        /// <returns>The value</returns>
        public static string GetClaimValue(this IClaimsIdentity identity, string claimType)
        {
            Contract.Requires(identity != null);
            Contract.Requires(identity.Claims != null);
            Contract.Requires(!String.IsNullOrEmpty(claimType));
            Contract.Ensures(Contract.Result <string>() != null);


            string value = null;

            if (identity.TryGetClaimValue(claimType, out value))
            {
                return(value);
            }

            throw new ClaimNotFoundException(claimType);
        }