Beispiel #1
0
        public static bool HasValidUMLSApiKey(this User user, string apiKey = null)
        {
            if (string.IsNullOrEmpty(apiKey) && !string.IsNullOrEmpty(user.UMLSApiKey))
            {
                apiKey = user.UMLSApiKey.DecryptStringAES();
            }

            if (string.IsNullOrEmpty(apiKey))
            {
                return(false);
            }

            return(UmlsHelper.ValidateLicense(apiKey));
        }
Beispiel #2
0
        public static bool HasValidUmlsLicense(this User user, string username = null, string password = null)
        {
            if (string.IsNullOrEmpty(username) && !string.IsNullOrEmpty(user.UMLSUsername))
            {
                username = user.UMLSUsername.DecryptStringAES();
            }

            if (string.IsNullOrEmpty(password) && !string.IsNullOrEmpty(user.UMLSPassword))
            {
                password = user.UMLSPassword.DecryptStringAES();
            }

            if (string.IsNullOrEmpty(username) || string.IsNullOrEmpty(password))
            {
                return(false);
            }

            return(UmlsHelper.ValidateLicense(username, password));
        }