hardcoded auth

parent 3ea4539e
Pipeline #10753 passed with stages
in 23 minutes 4 seconds
...@@ -25,9 +25,16 @@ namespace Mobile.Search.Web.Controllers ...@@ -25,9 +25,16 @@ namespace Mobile.Search.Web.Controllers
[ValidateAntiForgeryToken] [ValidateAntiForgeryToken]
public ActionResult Login(LoginModel model, string returnUrl) public ActionResult Login(LoginModel model, string returnUrl)
{ {
if (Membership.ValidateUser(model.UserName, model.Password)) //if (Membership.ValidateUser(model.UserName, model.Password))
//{
// FormsAuthentication.SetAuthCookie(model.UserName, model.RememberMe);
// return RedirectToLocal(returnUrl);
//}
//temporary hard-coded way
if (FormsAuthentication.Authenticate(model.UserName, model.Password))
{ {
FormsAuthentication.SetAuthCookie(model.UserName, model.RememberMe); FormsAuthentication.SetAuthCookie(model.UserName, false);
return RedirectToLocal(returnUrl); return RedirectToLocal(returnUrl);
} }
// If we got this far, something failed, redisplay form // If we got this far, something failed, redisplay form
......
...@@ -79,7 +79,12 @@ that is bundled with the nuget package under the tools folder. ...@@ -79,7 +79,12 @@ that is bundled with the nuget package under the tools folder.
</providers> </providers>
</membership> </membership>
<authentication mode="Forms"> <authentication mode="Forms">
<forms name=".ADAuthCookie" loginUrl="~/Account/Login" timeout="9440" slidingExpiration="false" protection="All" /> <forms loginUrl="~/Account/Login" name=".ASPXAUTH" slidingExpiration="true" timeout="1440" path="/" defaultUrl="~/YahooDataImport/UploadFile">
<credentials passwordFormat="Clear">
<user name="Admin" password="Show me the m0ney!"/>
</credentials>
</forms>
<!--<forms name=".ADAuthCookie" loginUrl="~/Account/Login" timeout="9440" slidingExpiration="false" protection="All" />-->
</authentication> </authentication>
<machineKey validationKey="9D917A96D5FCB1E02CB44567C415E175D54FB9352ED0F3F76C42F59149DECA28E1029A3F69080A4E876357974F5ED39E75FA50498A162CD2C8B62F7701531471" decryptionKey="3F660F6419346F1C477AC77ABF3B14E65BBBAC1FA3DBCEE48EDB0DD303033735" validation="SHA1" decryption="AES" /> <machineKey validationKey="9D917A96D5FCB1E02CB44567C415E175D54FB9352ED0F3F76C42F59149DECA28E1029A3F69080A4E876357974F5ED39E75FA50498A162CD2C8B62F7701531471" decryptionKey="3F660F6419346F1C477AC77ABF3B14E65BBBAC1FA3DBCEE48EDB0DD303033735" validation="SHA1" decryption="AES" />
</system.web> </system.web>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment