private AuthenticationParam ParseValue(Control markup, AuthenticationParam parametr)
        {
            var parametrValue = markup.FindControl(Name + parametr.Name) as TextBox;

            parametr.Value = (parametrValue != null) ? parametrValue.Text : String.Empty;
            return(parametr);
        }
示例#2
0
 public ServiceAccount()
 {
     this.ValidationEnabled = false;
     userName = new AuthenticationParam("Name", "User Name", String.Empty);
     password = new AuthenticationParam("Password", "Password", String.Empty);
     domain   = new AuthenticationParam("Domain", "Domain", String.Empty);
 }
示例#3
0
        public HttpResponseMessage PostLogin([FromBody] AuthenticationParam param)
        {
            try
            {
                var user = authService.login(param.username, param.password);


                return(Request.CreateResponse(HttpStatusCode.OK, user));
            }
            catch (Exception ex)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message.ToString()));
            }
        }
 private void AddParameter(Control panel, AuthenticationParam parametr, TextBox tb)
 {
     panel.Controls.Add(new HtmlGenericControl("div")
     {
         InnerText = parametr.Text
     });
     tb.ID = Name + parametr.Name;
     if (tb.TextMode == TextBoxMode.Password)
     {
         EncodePassword(tb, parametr.Value);
     }
     else
     {
         tb.Text = parametr.Value;
     }
     panel.Controls.Add(tb);
 }
 public OAuth()
 {
     ValidationEnabled = false;
     userName          = new AuthenticationParam("Name", "Login", String.Empty);
     password          = new AuthenticationParam("Password", "Password", String.Empty);
 }