コード例 #1
0
        public ValidateUmlsCredentialsResponseModel ValidateUMLSApiKey(ValidateUmlsCredentialsRequestModel model)
        {
            User current = CheckPoint.Instance.GetUser(this.tdb);
            ValidateUmlsCredentialsResponseModel response = new ValidateUmlsCredentialsResponseModel();

            // If they have a valid umls license, they have valid credentials
            if (current.HasValidUMLSApiKey(model.ApiKey))
            {
                response.CredentialsValid = true;
                response.LicenseValid     = true;
            }

            return(response);
        }
コード例 #2
0
        public ValidateUmlsCredentialsResponseModel ValidateUmlsCredentials(ValidateUmlsCredentialsRequestModel model)
        {
            User current = CheckPoint.Instance.GetUser(this.tdb);
            ValidateUmlsCredentialsResponseModel response = new ValidateUmlsCredentialsResponseModel();

            // If they have a valid umls license, they have valid credentials
            if (current.HasValidUmlsLicense(model.Username, model.Password))
            {
                response.CredentialsValid = true;
                response.LicenseValid     = true;
            }
            else
            {
                // If they don't have a valid umls license,
                // check if they can authenticate... Their credentials may be valid.
                if (current.HasValidUmlsCredentials(model.Username, model.Password))
                {
                    response.CredentialsValid = true;
                }
            }

            return(response);
        }