示例#1
1
 public MeApiController(UserManager<ApplicationUser> userManager,
     SignInManager<ApplicationUser> signInManager,
     IMediator mediator)
 {
     _userManager = userManager;
     _signInManager = signInManager;
     _mediator = mediator;
 }
示例#2
0
 public UsersController(ApplicationDbContext context, IHostingEnvironment environment,
     UserManager<ApplicationUser> userManager,
     SignInManager<ApplicationUser> signInManager,
     IServiceProvider serviceProvider)
     : base(context,environment,userManager,signInManager,serviceProvider)
 {
 }
示例#3
0
 public AccountController(UserManager<ApplicationUser> userMgr, SignInManager<ApplicationUser> signInMgr, ILogger<AccountController> log)
 {
    
     userManager = userMgr;
     signInManager = signInMgr;
     logger = log;
 }
 public AccountController(
     UserManager<ApplicationUser> userManager,
     SignInManager<ApplicationUser> signInManager)
 {
     UserManager = userManager;
     SignInManager = signInManager;
 }
示例#5
0
        public IdentityServices(DbContext context, IAuthenticationManager authenticationMana, UserStore<IdentityUser> userStor, UserManager<IdentityUser> userMena)
        {
            db = context;
            userStore = userStor;
            userMenager = userMena;
            authenticationManager = authenticationMana;

            userMenager.UserValidator = new UserValidator<IdentityUser>(userMenager) { RequireUniqueEmail = true, AllowOnlyAlphanumericUserNames = false };
            userMenager.PasswordValidator = new PasswordValidator() { RequiredLength = 6, RequireLowercase = true, RequireUppercase = true, RequireDigit = true };

            signInMenager = new SignInManager<IdentityUser, string>(userMenager, authenticationManager);
            
            userMenager.RegisterTwoFactorProvider("EmailCode", new EmailTokenProvider<IdentityUser>
            {
                Subject = "Security Code",
                BodyFormat = "Your security code is {0}"
            });

            userMenager.EmailService = new EmailService();

            var dataProtectionProvider = Startup.dataProtectionProvider;

            if (dataProtectionProvider != null)
            {
                IDataProtector dataProtector = dataProtectionProvider.Create("ASP.NET Identity");
                userMenager.UserTokenProvider = new DataProtectorTokenProvider<IdentityUser>(dataProtector);
            }
        }
 public AppController(IHttpContextAccessor httpContextAccessor,
         UserManager<MyUser> userManager,
         IOptions<IdentityOptions> optionsAccessor)
 {
     SignInManager = new MySignInManager(userManager as MyUserManager, httpContextAccessor, new MyClaimsPrincipleFactory());
     UserManager = userManager;
 }
 public AccountController(IConfigurationRoot appSettings, UserManager<ApplicationUser> userManager, SignInManager<ApplicationUser> signInManager, ILoggerFactory loggerFactory)
 {
     _appSettings = appSettings;
     _userManager = userManager;
     _signInManager = signInManager;
     _logger = loggerFactory.CreateLogger<AccountController>();
 }
 public AccountController(
     UserManager<IdentityUser> userManager,
     SignInManager<IdentityUser> signInManager)
 {
     _userManager = userManager;
     _signInManager = signInManager;
 }
 public UserService(UserManager<User, int> userManager, SignInManager<User, int> signinManager
     , IAuthenticationManager authManager)
 {
     _userManager = userManager;
     _signinManager = signinManager;
     _authManager = authManager;
 }
示例#10
0
        private static AccountController MockAccountController(SignInManager<ApplicationUser> mockSignInManager, UserManager<ApplicationUser> mockUserManager)
        {
            var mockEmailSender = new Mock<IEmailSender>();
            var mockSmsSender = new Mock<ISmsSender>();
            var mockApplicationDbContext = new Mock<ApplicationDbContext>();
            var mockEmailTemplate = new Mock<IEmailTemplate>();
            var mockNullLoggerFactory = new NullLoggerFactory();


            var mockLocalizer = new Mock<IStringLocalizer<AccountController>>();
            mockLocalizer.Setup(m => m[It.IsAny<string>()])
                .Returns<string>(x => new LocalizedString(x, x, false));
            mockLocalizer.Setup(m => m[It.IsAny<string>(), It.IsAny<object>()])
                .Returns<string, object[]>((x, y) => new LocalizedString(x, string.Format(x, y), false));

            var controller = new AccountController(mockUserManager, mockSignInManager, mockEmailSender.Object, mockSmsSender.Object, mockNullLoggerFactory, mockApplicationDbContext.Object, mockEmailTemplate.Object, mockLocalizer.Object);

            var mockUrl = new Mock<IUrlHelper>();
            mockUrl.Setup(m => m.IsLocalUrl("localUrl")).Returns(true);
            mockUrl.Setup(m => m.IsLocalUrl("remoteUrl")).Returns(false);

            controller.Url = mockUrl.Object;

            return controller;
        }
 public LoginController(
     SignInManager signInManager,
     SignInInteraction signInInteraction)
 {
     _signInManager = signInManager;
     _signInInteraction = signInInteraction;
 }
示例#12
0
 public AccountController(
     SignInManager<Identity> signInManager,
     ILoggerFactory loggerFactory)
 {
     _signInManager = signInManager;
     _logger = loggerFactory.CreateLogger<AccountController>();
 }
        public WeekBasketManagementController(ApplicationDbContext context, IHostingEnvironment environment,
            UserManager<ApplicationUser> userManager,
            SignInManager<ApplicationUser> signInManager,
            IServiceProvider serviceProvider) : base(serviceProvider, userManager, context, environment, signInManager)
        {

        }
示例#14
0
 public AccountController(
     UserManager<User> userManager,
     SignInManager<User> signInManager)
 {
     _signInManager = signInManager;
     _userManager = userManager;
 }
 public ManageController(
 UserManager<ApplicationUser> userManager,
 SignInManager<ApplicationUser> signInManager,)
 {
     _userManager = userManager;
     _signInManager = signInManager;
 }
示例#16
0
        public AuthRepository(ApplicationDbContext context,
            UserManager<ApplicationUser> userManager,
            SignInManager<ApplicationUser> signInManager) {
            this.db = context;
            this.userManager = userManager;
            this.signInManager = signInManager;

        }
示例#17
0
 public AccountController(UserManager<ApplicationUser> userManager, 
     SignInManager<ApplicationUser> signInManager, 
     TelemetryClient telemetryClient)
 {
     UserManager = userManager;
     SignInManager = signInManager;
     _telemetryClient = telemetryClient;
 }
 protected AccountGlobalService(RoleManager roleManager, UserManager userManager,SignInManager singInManager,
     IAuthenticationManager authentication)
 {
     _singInManager = singInManager;
     _roleManager = roleManager;
     _userManager = userManager;
     _authentication = authentication;
 }
示例#19
0
 public AccountController(UserManager<ApplicationUser> userManager, SignInManager<ApplicationUser> signInManager, IEmailSender emailSender, ISmsSender smsSender, ILogger<AccountController> logger)
 {
     _userManager = userManager;
     _signInManager = signInManager;
     _emailSender = emailSender;
     _smsSender = smsSender;
     _logger = logger;
 }
示例#20
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AccountController"/> class.
 /// </summary>
 /// <param name="personManager">
 /// The person manager <see cref="UserManager{Person}"/>
 /// </param>
 /// <param name="emailManager">
 /// The email Manager.
 /// </param>
 public AccountController(
     UserManager<Person> personManager,
     IEmailManager emailManager)
 {
     this.signInManager = new SignInManager<Person, string>(personManager, System.Web.HttpContext.Current.GetOwinContext().Authentication);
     this.personManager = personManager;
     this.emailManager = emailManager;
 }
示例#21
0
        public AccountController(UserManager<User> userManager, SignInManager<User> signInManager, CloudContext context, AccountRepository repository)
        {
            _userManager = userManager;
            _signInManager = signInManager;

            Repository = repository;
            CloudContext = context;
        }
 public UsuariosController(
     UserManager<ApplicationUser> userManager,
     SignInManager<ApplicationUser> signInManager,
     ApplicationDbContext applicationDbContext)
 {
     _userManager = userManager;
     _applicationDbContext = applicationDbContext;
 }
示例#23
0
 public ProducersController(ApplicationDbContext context, IHostingEnvironment environment,
     UserManager<ApplicationUser> userManager,
     SignInManager<ApplicationUser> signInManager)
 {
     _environment = environment;
     _context = context;
     _userManager = userManager;
     _signInManager = signInManager;
 }
示例#24
0
 public AccountController(
     UserManager<ApplicationUser> userManager,
     SignInManager<ApplicationUser> signInManager,
     ApplicationDbContext applicationDbContext)
 {
     _userManager = userManager;
     _signInManager = signInManager;
     _applicationDbContext = applicationDbContext;
 }
 public AccountController(
     UserManager<ApplicationUser, string> userManager,
     RoleManager<ApplicationRole, string> roleManager,
     SignInManager<ApplicationUser, string> signInManager)
 {
     this.UserManager = userManager;
     this.RoleManager = roleManager;
     this.SignInManager = signInManager;
 }
示例#26
0
 public TokenController(
     UserManager<ApplicationUser> userManager,
     SignInManager<ApplicationUser> signInManager,
     TokenAuthOptions tokenOptions)
 {
     _userManager = userManager;
     _signInManager = signInManager;
     _tokenOptions = tokenOptions;
 }
示例#27
0
        public async Task<ActionResult> VerifyCode(VerifyCodeViewModel model)
        {
            if (!ModelState.IsValid)
            {
                return View(model);
            }

            // The following code protects for brute force attacks against the two factor codes. 
            // If a user enters incorrect codes for a specified amount of time then the user account 
            // will be locked out for a specified amount of time. 
            // You can configure the account lockout settings in IdentityConfig
            var result = await SignInManager.TwoFactorSignInAsync(model.Provider, model.Code, isPersistent:  model.RememberMe, rememberBrowser: model.RememberBrowser);
            switch (result)
            {
                case SignInStatus.Success:
                    return RedirectToLocal(model.ReturnUrl);
                case SignInStatus.LockedOut:
                    return View("Lockout");
                case SignInStatus.Failure:
                default:
                    ModelState.AddModelError("", "Invalid code.");
                    return View(model);
            }
        }
示例#28
0
        public async Task<ActionResult> Register(RegisterViewModel model)
        {
            if (ModelState.IsValid)
            {
                var user = new ApplicationUser { UserName = model.Email, Email = model.Email };
                var result = await UserManager.CreateAsync(user, model.Password);
                if (result.Succeeded)
                {
                    await SignInManager.SignInAsync(user, isPersistent:false, rememberBrowser:false);
                    
                    // For more information on how to enable account confirmation and password reset please visit http://go.microsoft.com/fwlink/?LinkID=320771
                    // Send an email with this link
                    // string code = await UserManager.GenerateEmailConfirmationTokenAsync(user.Id);
                    // var callbackUrl = Url.Action("ConfirmEmail", "Account", new { userId = user.Id, code = code }, protocol: Request.Url.Scheme);
                    // await UserManager.SendEmailAsync(user.Id, "Confirm your account", "Please confirm your account by clicking <a href=\"" + callbackUrl + "\">here</a>");

                    return RedirectToAction("Index", "Home");
                }
                AddErrors(result);
            }

            // If we got this far, something failed, redisplay form
            return View(model);
        }
示例#29
0
 public AccountController(
     ApplicationDbContext context,
     IHostingEnvironment host,
     UserManager <ApplicationUser> userManager,
     RoleManager <IdentityRole> roleManager,
     SignInManager <ApplicationUser> signInManager,
     IOptionsSnapshot <PhotoSettings> photoSettings,
     IOptionsSnapshot <TokenSettings> tokenSettings,
     IEmailSender emailSender,
     IMapper mapper,
     IUserService userService
     )
 {
     this.context       = context;
     this.roleManager   = roleManager;
     this.userManager   = userManager;
     this.signInManager = signInManager;
     this.emailSender   = emailSender;
     this.host          = host;
     this.photoSettings = photoSettings.Value;
     this.tokenSettings = tokenSettings.Value;
     this.mapper        = mapper;
     this.userService   = userService;
 }
示例#30
0
        public async Task<ActionResult> Login(LoginViewModel model, string returnUrl)
        {
            if (!ModelState.IsValid)
            {
                return View(model);
            }

            // This doesn't count login failures towards account lockout
            // To enable password failures to trigger account lockout, change to shouldLockout: true
            var result = await SignInManager.PasswordSignInAsync(model.Email, model.Password, model.RememberMe, shouldLockout: false);
            switch (result)
            {
                case SignInStatus.Success:
                    return RedirectToLocal(returnUrl);
                case SignInStatus.LockedOut:
                    return View("Lockout");
                case SignInStatus.RequiresVerification:
                    return RedirectToAction("SendCode", new { ReturnUrl = returnUrl, RememberMe = model.RememberMe });
                case SignInStatus.Failure:
                default:
                    ModelState.AddModelError("", "Invalid login attempt.");
                    return View(model);
            }
        }
 public InstitutemManagementController(UserManager <ApplicationUser> userManager, SignInManager <ApplicationUser> signInManager,
                                       IMSDbContext iMSDbContext) : base(userManager, iMSDbContext)
 {
     _userManager   = userManager;
     _signInManager = signInManager;
     _iMSDbContext  = iMSDbContext;
 }
示例#32
0
 public AccountController(UserManager <ApplicationUser> userManager, SignInManager <ApplicationUser> singInManager)
 {
     this.userManager   = userManager;
     this.singInManager = singInManager;
 }
        #pragma warning disable 1998
        public async override global::System.Threading.Tasks.Task ExecuteAsync()
        {
#line 2 "I:\IDB-BISEW\MVC CORE\MVC CORE PROJECT\Mvc Core v5  final\mvc_asp_core_project_1251661\mvc_asp_core\Areas\Identity\Pages\Account\Manage\_ManageNav.cshtml"
  
    var hasExternalLogins = (await SignInManager.GetExternalAuthenticationSchemesAsync()).Any();

#line default
#line hidden
            BeginContext(157, 47, true);
            WriteLiteral("<ul class=\"nav nav-pills nav-stacked\">\r\n    <li");
            EndContext();
            BeginWriteAttribute("class", " class=\"", 204, "\"", 254, 1);
#line 6 "I:\IDB-BISEW\MVC CORE\MVC CORE PROJECT\Mvc Core v5  final\mvc_asp_core_project_1251661\mvc_asp_core\Areas\Identity\Pages\Account\Manage\_ManageNav.cshtml"
WriteAttributeValue("", 212, ManageNavPages.IndexNavClass(ViewContext), 212, 42, false);

#line default
#line hidden
            EndWriteAttribute();
            BeginContext(255, 1, true);
            WriteLiteral(">");
            EndContext();
            BeginContext(256, 33, false);
            __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "be7ba0eaa4fc48828da049c7bf6e15e1", async() => {
                BeginContext(278, 7, true);
                WriteLiteral("Profile");
                EndContext();
            }
            );
            __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper>();
            __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper);
            __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Page = (string)__tagHelperAttribute_0.Value;
            __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_0);
            await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
            if (!__tagHelperExecutionContext.Output.IsContentModified)
            {
                await __tagHelperExecutionContext.SetOutputContentAsync();
            }
            Write(__tagHelperExecutionContext.Output);
            __tagHelperExecutionContext = __tagHelperScopeManager.End();
            EndContext();
            BeginContext(289, 14, true);
            WriteLiteral("</li>\r\n    <li");
            EndContext();
            BeginWriteAttribute("class", " class=\"", 303, "\"", 362, 1);
#line 7 "I:\IDB-BISEW\MVC CORE\MVC CORE PROJECT\Mvc Core v5  final\mvc_asp_core_project_1251661\mvc_asp_core\Areas\Identity\Pages\Account\Manage\_ManageNav.cshtml"
WriteAttributeValue("", 311, ManageNavPages.ChangePasswordNavClass(ViewContext), 311, 51, false);

#line default
#line hidden
            EndWriteAttribute();
            BeginContext(363, 1, true);
            WriteLiteral(">");
            EndContext();
            BeginContext(364, 64, false);
            __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "4918f199f968465dba813b9774df680e", async() => {
                BeginContext(416, 8, true);
                WriteLiteral("Password");
                EndContext();
            }
            );
            __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper>();
            __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper);
            __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_1);
            __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Page = (string)__tagHelperAttribute_2.Value;
            __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_2);
            await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
            if (!__tagHelperExecutionContext.Output.IsContentModified)
            {
                await __tagHelperExecutionContext.SetOutputContentAsync();
            }
            Write(__tagHelperExecutionContext.Output);
            __tagHelperExecutionContext = __tagHelperScopeManager.End();
            EndContext();
            BeginContext(428, 7, true);
            WriteLiteral("</li>\r\n");
            EndContext();
#line 8 "I:\IDB-BISEW\MVC CORE\MVC CORE PROJECT\Mvc Core v5  final\mvc_asp_core_project_1251661\mvc_asp_core\Areas\Identity\Pages\Account\Manage\_ManageNav.cshtml"
     if (hasExternalLogins)
    {

#line default
#line hidden
            BeginContext(471, 11, true);
            WriteLiteral("        <li");
            EndContext();
            BeginWriteAttribute("class", " class=\"", 482, "\"", 541, 1);
#line 10 "I:\IDB-BISEW\MVC CORE\MVC CORE PROJECT\Mvc Core v5  final\mvc_asp_core_project_1251661\mvc_asp_core\Areas\Identity\Pages\Account\Manage\_ManageNav.cshtml"
WriteAttributeValue("", 490, ManageNavPages.ExternalLoginsNavClass(ViewContext), 490, 51, false);

#line default
#line hidden
            EndWriteAttribute();
            BeginContext(542, 1, true);
            WriteLiteral(">");
            EndContext();
            BeginContext(543, 70, false);
            __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "7793c2c7c07b46f4a885a51c2e412380", async() => {
                BeginContext(594, 15, true);
                WriteLiteral("External logins");
                EndContext();
            }
            );
            __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper>();
            __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper);
            __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_3);
            __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Page = (string)__tagHelperAttribute_4.Value;
            __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_4);
            await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
            if (!__tagHelperExecutionContext.Output.IsContentModified)
            {
                await __tagHelperExecutionContext.SetOutputContentAsync();
            }
            Write(__tagHelperExecutionContext.Output);
            __tagHelperExecutionContext = __tagHelperScopeManager.End();
            EndContext();
            BeginContext(613, 7, true);
            WriteLiteral("</li>\r\n");
            EndContext();
#line 11 "I:\IDB-BISEW\MVC CORE\MVC CORE PROJECT\Mvc Core v5  final\mvc_asp_core_project_1251661\mvc_asp_core\Areas\Identity\Pages\Account\Manage\_ManageNav.cshtml"
    }

#line default
#line hidden
            BeginContext(627, 7, true);
            WriteLiteral("    <li");
            EndContext();
            BeginWriteAttribute("class", " class=\"", 634, "\"", 702, 1);
#line 12 "I:\IDB-BISEW\MVC CORE\MVC CORE PROJECT\Mvc Core v5  final\mvc_asp_core_project_1251661\mvc_asp_core\Areas\Identity\Pages\Account\Manage\_ManageNav.cshtml"
WriteAttributeValue("", 642, ManageNavPages.TwoFactorAuthenticationNavClass(ViewContext), 642, 60, false);

#line default
#line hidden
            EndWriteAttribute();
            BeginContext(703, 1, true);
            WriteLiteral(">");
            EndContext();
            BeginContext(704, 69, false);
            __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "45a4f05cca214cec89a4b247b589fd6e", async() => {
                BeginContext(744, 25, true);
                WriteLiteral("Two-factor authentication");
                EndContext();
            }
            );
            __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper>();
            __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper);
            __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Page = (string)__tagHelperAttribute_5.Value;
            __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_5);
            await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
            if (!__tagHelperExecutionContext.Output.IsContentModified)
            {
                await __tagHelperExecutionContext.SetOutputContentAsync();
            }
            Write(__tagHelperExecutionContext.Output);
            __tagHelperExecutionContext = __tagHelperScopeManager.End();
            EndContext();
            BeginContext(773, 14, true);
            WriteLiteral("</li>\r\n    <li");
            EndContext();
            BeginWriteAttribute("class", " class=\"", 787, "\"", 844, 1);
#line 13 "I:\IDB-BISEW\MVC CORE\MVC CORE PROJECT\Mvc Core v5  final\mvc_asp_core_project_1251661\mvc_asp_core\Areas\Identity\Pages\Account\Manage\_ManageNav.cshtml"
WriteAttributeValue("", 795, ManageNavPages.PersonalDataNavClass(ViewContext), 795, 49, false);

#line default
#line hidden
            EndWriteAttribute();
            BeginContext(845, 1, true);
            WriteLiteral(">");
            EndContext();
            BeginContext(846, 46, false);
            __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "f4bb157efdb74bc8bd067f56e58f748e", async() => {
                BeginContext(875, 13, true);
                WriteLiteral("Personal data");
                EndContext();
            }
            );
            __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper = CreateTagHelper<global::Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper>();
            __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper);
            __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Page = (string)__tagHelperAttribute_6.Value;
            __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_6);
            await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
            if (!__tagHelperExecutionContext.Output.IsContentModified)
            {
                await __tagHelperExecutionContext.SetOutputContentAsync();
            }
            Write(__tagHelperExecutionContext.Output);
            __tagHelperExecutionContext = __tagHelperScopeManager.End();
            EndContext();
            BeginContext(892, 14, true);
            WriteLiteral("</li>\r\n</ul>\r\n");
            EndContext();
        }
示例#34
0
 public SignInService(ICreditUnionUserService creditUnionUserService, SignInManager<CreditUnionUser> signInManager)
 {
     _creditUnionUserService = creditUnionUserService;
     _signInManager = signInManager;
 }
示例#35
0
 public ConfirmEmailChangeModel(UserManager<IdentityUser> userManager, SignInManager<IdentityUser> signInManager)
 {
     _userManager = userManager;
     _signInManager = signInManager;
 }
示例#36
0
        // GET: /<controller>/

        public AuthController(SignInManager <WorldUser> signInManager, UserManager <WorldUser> userManager, IProfileService profileService)
        {
            _signInManager  = signInManager;
            _userManager    = userManager;
            _profileService = profileService;
        }
示例#37
0
 public LoginModel(SignInManager <ApplicationUser> signInManager)
 {
     _signInManager = signInManager;
 }
示例#38
0
 public LoginModel(SignInManager<GameAppUser> signInManager, ILogger<LoginModel> logger)
 {
     _signInManager = signInManager;
     _logger = logger;
 }
示例#39
0
 public UsersController()
 {
     this.signManager = new SignInManager(new UserContext());
 }
示例#40
0
 public LogoutModel(SignInManager<SiteUser> signInManager, ILogger<LogoutModel> logger)
 {
     _signInManager = signInManager;
     _logger = logger;
 }
示例#41
0
        #pragma warning disable 1998
        public async override global::System.Threading.Tasks.Task ExecuteAsync()
        {
            BeginContext(38, 2, true);
            WriteLiteral("\r\n");
            EndContext();
            BeginContext(138, 2, true);
            WriteLiteral("\r\n");
            EndContext();
#line 6 "C:\Users\Zoki\Desktop\Naras_Kitchen_last - Copy\Naras_Kitchen\Naras_Kitchen\Views\Shared\_LoginPartial.cshtml"
            if (SignInManager.IsSignedIn(User))
            {
#line default
#line hidden
                BeginContext(181, 4, true);
                WriteLiteral("    ");
                EndContext();
                BeginContext(185, 673, false);
                __tagHelperExecutionContext = __tagHelperScopeManager.Begin("form", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "20fe5ddffab84b1f9340783ee5d99fab", async() => {
                    BeginContext(358, 103, true);
                    WriteLiteral("\r\n        <ul class=\"nav navbar-nav navbar-right\">\r\n            <li class=\"nav-item\">\r\n                ");
                    EndContext();
                    BeginContext(461, 177, false);
                    __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "e1980bd34dd94dd683da0e6b72ae4981", async() => {
                        BeginContext(597, 6, true);
                        WriteLiteral("Hello ");
                        EndContext();
                        BeginContext(604, 29, false);
#line 11 "C:\Users\Zoki\Desktop\Naras_Kitchen_last - Copy\Naras_Kitchen\Naras_Kitchen\Views\Shared\_LoginPartial.cshtml"
                        Write(UserManager.GetUserName(User));

#line default
#line hidden
                        EndContext();
                        BeginContext(633, 1, true);
                        WriteLiteral("!");
                        EndContext();
                    }
                                                                                );
                    __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper>();
                    __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper);
                    __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Area = (string)__tagHelperAttribute_0.Value;
                    __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_0);
                    __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Page = (string)__tagHelperAttribute_1.Value;
                    __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_1);
                    __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_2);
                    __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_3);
                    __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_4);
                    await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
                    if (!__tagHelperExecutionContext.Output.IsContentModified)
                    {
                        await __tagHelperExecutionContext.SetOutputContentAsync();
                    }
                    Write(__tagHelperExecutionContext.Output);
                    __tagHelperExecutionContext = __tagHelperScopeManager.End();
                    EndContext();
                    BeginContext(638, 213, true);
                    WriteLiteral("\r\n            </li>\r\n            <li class=\"nav-item\">\r\n                <button type=\"submit\" class=\"btn btn-link navbar-btn navbar-link\" style=\"color:white\">Logout</button>\r\n            </li>\r\n        </ul>\r\n    ");
                    EndContext();
                }
                                                                            );
                __Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.FormTagHelper>();
                __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper);
                __Microsoft_AspNetCore_Mvc_TagHelpers_RenderAtEndOfFormTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.RenderAtEndOfFormTagHelper>();
                __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_RenderAtEndOfFormTagHelper);
                __Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper.Area = (string)__tagHelperAttribute_0.Value;
                __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_0);
                __Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper.Page = (string)__tagHelperAttribute_5.Value;
                __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_5);
                if (__Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper.RouteValues == null)
                {
                    throw new InvalidOperationException(InvalidTagHelperIndexerAssignment("asp-route-returnUrl", "Microsoft.AspNetCore.Mvc.TagHelpers.FormTagHelper", "RouteValues"));
                }
                BeginWriteTagHelperAttribute();
#line 8 "C:\Users\Zoki\Desktop\Naras_Kitchen_last - Copy\Naras_Kitchen\Naras_Kitchen\Views\Shared\_LoginPartial.cshtml"
                WriteLiteral(Url.Action("Home", "Home", new { area = "" }));

#line default
#line hidden
                __tagHelperStringValueBuffer = EndWriteTagHelperAttribute();
                __Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper.RouteValues["returnUrl"] = __tagHelperStringValueBuffer;
                __tagHelperExecutionContext.AddTagHelperAttribute("asp-route-returnUrl", __Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper.RouteValues["returnUrl"], global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes);
                __Microsoft_AspNetCore_Mvc_TagHelpers_FormTagHelper.Method = (string)__tagHelperAttribute_6.Value;
                __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_6);
                __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_7);
                __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_8);
                await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);

                if (!__tagHelperExecutionContext.Output.IsContentModified)
                {
                    await __tagHelperExecutionContext.SetOutputContentAsync();
                }
                Write(__tagHelperExecutionContext.Output);
                __tagHelperExecutionContext = __tagHelperScopeManager.End();
                EndContext();
                BeginContext(858, 2, true);
                WriteLiteral("\r\n");
                EndContext();
#line 18 "C:\Users\Zoki\Desktop\Naras_Kitchen_last - Copy\Naras_Kitchen\Naras_Kitchen\Views\Shared\_LoginPartial.cshtml"
            }
            else
            {
#line default
#line hidden
                BeginContext(872, 75, true);
                WriteLiteral("    <ul class=\"nav navbar-nav navbar-right\">\r\n        <li class=\"nav-item\">");
                EndContext();
                BeginContext(947, 96, false);
                __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "712f8eadb73f45808b9972eb5d203050", async() => {
                    BeginContext(1031, 8, true);
                    WriteLiteral("Register");
                    EndContext();
                }
                                                                            );
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper>();
                __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper);
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Area = (string)__tagHelperAttribute_0.Value;
                __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_0);
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Page = (string)__tagHelperAttribute_9.Value;
                __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_9);
                __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_10);
                await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);

                if (!__tagHelperExecutionContext.Output.IsContentModified)
                {
                    await __tagHelperExecutionContext.SetOutputContentAsync();
                }
                Write(__tagHelperExecutionContext.Output);
                __tagHelperExecutionContext = __tagHelperScopeManager.End();
                EndContext();
                BeginContext(1043, 36, true);
                WriteLiteral("</li>\r\n        <li class=\"nav-item\">");
                EndContext();
                BeginContext(1079, 90, false);
                __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "57babea8d8634bafa6c829b317567ca9", async() => {
                    BeginContext(1160, 5, true);
                    WriteLiteral("Login");
                    EndContext();
                }
                                                                            );
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper>();
                __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper);
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Area = (string)__tagHelperAttribute_0.Value;
                __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_0);
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Page = (string)__tagHelperAttribute_11.Value;
                __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_11);
                __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_10);
                await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);

                if (!__tagHelperExecutionContext.Output.IsContentModified)
                {
                    await __tagHelperExecutionContext.SetOutputContentAsync();
                }
                Write(__tagHelperExecutionContext.Output);
                __tagHelperExecutionContext = __tagHelperScopeManager.End();
                EndContext();
                BeginContext(1169, 18, true);
                WriteLiteral("</li>\r\n    </ul>\r\n");
                EndContext();
#line 25 "C:\Users\Zoki\Desktop\Naras_Kitchen_last - Copy\Naras_Kitchen\Naras_Kitchen\Views\Shared\_LoginPartial.cshtml"
            }

#line default
#line hidden
        }
示例#42
0
 public AccountController(AppDbContext appDbContext, UserManager<AppUser> userManager, SignInManager<AppUser> signIn, RoleManager<IdentityRole> roleManager)
 {
     _context = appDbContext;
     _userManager = userManager;
     _roleManager = roleManager;
     _signInManager = signIn;
     //user manager only has one password validator
     _passwordValidator = (PasswordValidator<AppUser>)userManager.PasswordValidators.FirstOrDefault();
 }
示例#43
0
 public AccountController(UserManager <User> userManager, SignInManager <User> signInManager, CivilizationDbContext db)
 {
     _userManager   = userManager;
     _signInManager = signInManager;
     _db            = db;
 }
 public StartController(UserManager<User> userManager, SignInManager<User> signInManager)
 {
     this.userManager = userManager;
     this.signInManager = signInManager;
 }
示例#45
0
 public LoginWithRecoveryCodeModel(SignInManager <ApplicationUser> signInManager, ILogger <LoginWithRecoveryCodeModel> logger)
 {
     _signInManager = signInManager;
     _logger        = logger;
 }
 public AccountController(SignInManager<AspNetUser> signInManager, IUserCaching cachedUser, IConfiguration config, IDbSettingsReader settings, ILogger<AccountController> logger) : base(signInManager, cachedUser, config, settings, logger)
 {
 }
        public async Task <ActionResult> Register(RegisterViewModel model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            var user = new User
            {
                UserName  = model.UserName,
                FirstName = model.FirstName,
                LastName  = model.LastName,
                Email     = model.UserName,
                FullName  = UserInfoProvider.GetFullName(model.FirstName, null, model.LastName),
                Enabled   = true
            };

            var registerResult = new IdentityResult();

            try
            {
                registerResult = await UserManager.CreateAsync(user, model.Password);
            }
            catch (Exception ex)
            {
                Service.Resolve <IEventLogService>().LogException("AccountController", "Register", ex);
                ModelState.AddModelError(String.Empty, ResHelper.GetString("register_failuretext"));
            }

            if (registerResult.Succeeded)
            {
                membershipActivitiesLogger.LogRegistration(model.UserName);
                var signInResult = await SignInManager.PasswordSignInAsync(model.UserName, model.Password, true, false);

                if (signInResult == SignInStatus.Success)
                {
                    ContactManagementContext.UpdateUserLoginContact(model.UserName);

                    SendRegistrationSuccessfulEmail(user.Email);
                    membershipActivitiesLogger.LogLogin(model.UserName);

                    return(Redirect(Url.Kentico().PageUrl(ContentItemIdentifiers.HOME)));
                }

                if (signInResult == SignInStatus.LockedOut)
                {
                    if (user.WaitingForApproval)
                    {
                        SendWaitForApprovalEmail(user.Email);
                    }

                    return(RedirectToAction("RequireConfirmedAccount"));
                }
            }

            foreach (var error in registerResult.Errors)
            {
                ModelState.AddModelError(String.Empty, error);
            }

            return(View(model));
        }
示例#48
0
 public StartModel(SignInManager <ApplicationUser> signInManager)
     : base(signInManager)
 {
 }
示例#49
0
 public AccountController(UserManager<TeacherProfile> userManager, SignInManager<TeacherProfile> signInManager)
 {
     _userManager = userManager;
     _signInManager = signInManager;
 }
示例#50
0
 public AccountController(SignInManager <ApplicationUser> signInManager, ILogger <AccountController> logger)
 {
     _signInManager = signInManager;
     _logger        = logger;
 }
示例#51
0
 public MyPageController(UserManager <AppUser> userManager, SignInManager <AppUser> signInManager, RoleManager <AppUserRole> roleManager)
 {
     _userManager   = userManager;
     _signInManager = signInManager;
     _roleManager   = roleManager;
 }
示例#52
0
 public LoginWith2faModel(SignInManager <IdentityUser> signInManager, ILogger <LoginWith2faModel> logger)
 {
     _signInManager = signInManager;
     _logger        = logger;
 }
 public AuthController(UserManager<K101User> userManager, SignInManager<K101User> signInManager, EcommerceContext context)
 {
     _userManager = userManager;
     _signInManager = signInManager;
     _context = context;
 }
示例#54
0
 public LoginModel(SignInManager <ApplicationUser> signInManager, ILogger <LoginModel> logger)
 {
     _signInManager = signInManager;
     _logger        = logger;
 }
 public LoginController(SignInManager <Usuario> signInManager)
 {
     _signInManager = signInManager;
 }
示例#56
0
 public AccountController(UserManager<AppUser> userManager, SignInManager<AppUser> signInManager, IUserServices userServices)
 {
     _userManager = userManager;
     _signInManager = signInManager;
     _userServices = userServices;
 }
        public UserManagerService(UserManager<AppIdentityUser> userMenager, IAuthenticationManager authenticationManager, RoleManager<IdentityRole> roleManager)
        {
            this._userMenager = userMenager;
            this._authenticationManager = authenticationManager;
            this._roleManager = roleManager;

            //Pasword validation rules

            _userMenager.UserValidator = new UserValidator<AppIdentityUser>(userMenager) { RequireUniqueEmail = true, AllowOnlyAlphanumericUserNames = false };
            _userMenager.PasswordValidator = new PasswordValidator() { RequiredLength = 6, RequireLowercase = true, RequireUppercase = true, RequireDigit = true };
            _signInMenager = new SignInManager<AppIdentityUser, string>(_userMenager, _authenticationManager);

            //_userMenager.UserLockoutEnabledByDefault = true;
            //_userMenager.DefaultAccountLockoutTimeSpan = TimeSpan.FromDays(int.MaxValue);
            //_userMenager.SetLockoutEnabled(user.Id, enabled) // Enables or disables lockout for a user 
            //Register e-mail service for identity

            _userMenager.EmailService = new EmailService();

            //Token provider for password reset
            var dataProtectionProvider = Startup.dataProtectionProvider;
            if (dataProtectionProvider != null)
            {
                IDataProtector dataProtector = dataProtectionProvider.Create("ASP.NET Identity");
                userMenager.UserTokenProvider = new DataProtectorTokenProvider<AppIdentityUser>(dataProtector);
            }
        }
示例#58
-1
 public UserController(SignInManager<ChirpUser> a_signInManager, UserManager<ChirpUser> a_userManager, ILogger<UserController> a_logger, IEmailSender a_emailSender)
 {
     m_signInManager = a_signInManager;
     m_userManager = a_userManager;
     m_logger = a_logger;
     m_emailSender = a_emailSender;
 }
 public AdminMessagesController(
     UserManager<ApplicationUser> userManager,
     SignInManager<ApplicationUser> signInManager,
     ApplicationDbContext context)
 {
     _userManager = userManager;
     _signInManager = signInManager;
     _context = context;
 }
 public ManageController(
 UserManager<ApplicationUser> userManager,
 SignInManager<ApplicationUser> signInManager,
 ILoggerFactory loggerFactory)
 {
     _userManager = userManager;
     _signInManager = signInManager;
     _logger = loggerFactory.CreateLogger<ManageController>();
 }