asp.net - System.Web.Services : is there password property in Context.User.Identity -


just small query

i m using .net web service , created simple login method

[webmethod]     public bool login(string susername, string spwd)     {         if (susername == context.user.identity.name && **spwd == "123456"**)         {             formsauthentication.setauthcookie(susername, true);             return true;         }         else             return false;      } 

is there password property "context.user.identity.name" . or other alternative

please suggest if missing

your approach doesn't make sense. context.user set forms authentication module relies on information forms cookie. you, on other hand, try use information acually issue cookie.

this means need cookie issue cookie. won't work.

try rethink approach - need external data source, database or something, validate users against. in database have both usernames , passwords stored somehow.


Comments

Popular posts from this blog

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -