/// <summary>
        /// Initializes a new instance of the <see cref="AuthorisationRepository"/> class.
        /// </summary>
        public AuthorisationRepository()
        {
            _ctx = new AuthorisationContext();

            //again to save time using Identity's UserManager class, ideally we would have our own user authenticator, for e.g. would need to check how many times password is hashed (OWASP guidelines suggest hashing a couple of times)
            _userManager = new UserManager<IdentityUser>(new UserStore<IdentityUser>(_ctx));
            //userManager is enough to find or create a user
        }
Esempio n. 2
0
 public AuthorisationController(AuthorisationContext context)
 {
     _context = context;
 }