/* * Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ using Microsoft.AspNetCore.Identity; namespace Amazon.AspNetCore.Identity.Cognito { /// /// Implements ILookupNormalizer by returning the key without changes as Cognito is case sensitive. /// For instance, a group named 'Test' is not the same as a group named 'test' in Cognito. /// The same is applicable to usernames. /// public class CognitoKeyNormalizer : ILookupNormalizer { #if NETSTANDARD2_0 /// /// Normalizes the key to be be used by Cognito. /// /// The key to normalize /// public string Normalize(string key) { // Cognito does not handle normalization, returning the key as is. return key; } #endif #if NETCOREAPP3_1 /// /// Returns a normalized representation of the specified . /// /// The key to normalize. /// A normalized representation of the specified . public string NormalizeName(string name) { // Cognito does not handle normalization, returning the name as is. return name; } /// /// Returns a normalized representation of the specified . /// /// The email to normalize. /// A normalized representation of the specified . public string NormalizeEmail(string email) { // Cognito does not handle normalization, returning the email as is. return email; } #endif } }