Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Data;
- using System.Data.Entity;
- using System.Data.Entity.Infrastructure;
- using System.Linq;
- using System.Net;
- using System.Net.Http;
- using System.Web.Http;
- using System.Web.Http.Description;
- using WebFormsDemo;
- using WebFormsDemo.ViewModel;
- using System.Security.Cryptography;
- using System.Web.Helpers;
- using Microsoft.AspNet.Identity;
- using Microsoft.AspNet.Identity.Owin;
- using Microsoft.Owin.Security;
- using Microsoft.AspNet.Identity.EntityFramework;
- namespace WebFormsDemo.Controllers
- {
- public class LoginController : ApiController
- {
- private EBMSEntities db = new EBMSEntities();
- [Route("api/Login/Search/{username}/{password}")]
- [ResponseType(typeof(List<AspNetUser>))]
- public bool getUserPassword(string username, string password)
- {
- var hashedPassword = "";
- hashedPassword = Crypto.HashPassword(password);
- var user = (from u in db.AspNetUsers
- where u.UserName.Equals(username)
- && u.PasswordHash.Equals(hashedPassword)
- select u).ToList();
- if (user.Count() != 0)
- {
- return true;
- }
- return false;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement