Ejemplo n.º 1
0
        /// <summary>
        /// Select a second level value from the json user data with the given top level key name and second level sub key name and add it as a Claim.
        /// This no-ops if the keys are not found or the value is empty.
        /// </summary>
        /// <param name="collection">The <see cref="ClaimActionCollection"/>.</param>
        /// <param name="claimType">The value to use for Claim.Type when creating a Claim.</param>
        /// <param name="jsonKey">The top level key to look for in the json user data.</param>
        /// <param name="subKey">The second level key to look for in the json user data.</param>
        public static void MapJsonSubKey(this ClaimActionCollection collection, string claimType, string jsonKey, string subKey)
        {
            if (collection == null)
            {
                throw new ArgumentNullException(nameof(collection));
            }

            collection.MapJsonSubKey(claimType, jsonKey, subKey, ClaimValueTypes.String);
        }
 /// <summary>
 /// Select a second level value from the json user data with the given top level key name and second level sub key name and add it as a Claim.
 /// This no-ops if the keys are not found or the value is empty.
 /// </summary>
 /// <param name="collection"></param>
 /// <param name="claimType">The value to use for Claim.Type when creating a Claim.</param>
 /// <param name="jsonKey">The top level key to look for in the json user data.</param>
 /// <param name="subKey">The second level key to look for in the json user data.</param>
 public static void MapJsonSubKey(this ClaimActionCollection collection, string claimType, string jsonKey, string subKey)
 {
     collection.MapJsonSubKey(claimType, jsonKey, subKey, ClaimValueTypes.String);
 }