asp.net-identity

Identity in ASP.NET MVC Framework using Identity Core

♀尐吖头ヾ 提交于 2019-12-23 04:22:54
问题 I am having trouble with switching partially to .NET Standard. I am in the process of migrating a class library to .NET Standard, in this library I have the repositories and the database communication. I already migrated this successfully to use AspNetCore.Identity.EntityFrameworkCore . What I try to achieve is eventually having 1 .NET Standard project taking care of the database, where 1 MVC .NET Framework, 1 API .NET Framework and 1 new .NET Core application will be using it. Besides that a

How to extend ASP IdentityRole in EF DbFirst

放肆的年华 提交于 2019-12-23 03:48:27
问题 How can I extend the IdentityRoles to work with an extended AspNetRoles Table? in ASP MVC 5, with Identity 2.2 I looked here & here the answers do not help with DB First EF Step 1: I extended/added the CompanyId & DescRole (to make Role unique by company/tenant) CREATE TABLE [dbo].[AspNetRoles] // EXTENDED role table [Id] [nvarchar](50) NOT NULL, [Name] [nvarchar](50) NOT NULL, [Description] [nvarchar](50) NOT NULL, // EXTENDED [CompanyId] [nvarchar](50) NOT NULL, // EXTENDED Company/Tenant

Identity Server 4 (2.0) not reading Asp.Net Core Identity cookies

霸气de小男生 提交于 2019-12-23 03:31:40
问题 I am trying to use Asp .Net Identity Core with Identity Server 4. I can see in the logs (Ids) that the user is logged in properly. info: Xena.IdentityServer.Controllers.AccountController[0] User logged in. My login controller then sends the user over to my Manage controller. [Route("[controller]/[action]")] [Authorize] //[Authorize(AuthenticationSchemes = "Identity.Application")] public class ManageController : Controller { [HttpGet] public async Task<IActionResult> Index(ManageMessageId?

Refresh user name in navbar after username has changed (Using Asp.Net, MVC and C#)

若如初见. 提交于 2019-12-23 03:11:43
问题 I am trying to update the user name in the navbar (using ASP.NET, MVC, C#) after a user has changed his or here user name when signed in. So the user name is shown, but when it's changed the old user name is still being displayed in the navbar until the user loges out and in again. Dose any one know how to display the new user name in the navbar in a nice way? This is a short version of how the navbar looks like: <nav class="navbar navbar-default navbar-fixed-top"> @if (Request

Extend ASP Identity Role to add group(company)

痞子三分冷 提交于 2019-12-23 02:44:11
问题 How can I extend ASP Identity 2.2 Roles, to support isolated roles in their own groups , such as company1, company2 etc. I am trying to scope and limit roles to a Company, such that each company can administer their own roles and have similarly named roles - under the company purview only. I looked around and could not find a simpleway to extend the roles In the samples, while it shows how to extend user profiles easily, it fails to do so on the roles side of the house! 来源: https:/

Specified key was too long; max key length is 767 bytes - ASPNet Identity MySQL

别等时光非礼了梦想. 提交于 2019-12-23 02:32:55
问题 I have created an MVC Application with Identity and MySQL. I have created my entities but when I come to creating the user table it fails with the error specified in the title. I have searched around and people have said that the UserName , Name and Email properties are too long. I've tired to set a max length on these columns like the below example but I haven't been able to get it to work. IdentityModel: [DbConfigurationType(typeof(MySql.Data.Entity.MySqlEFConfiguration))] public class

Sharing authentication cookie among Asp.Net Core 1 (MVC6) and MVC 5 applications

醉酒当歌 提交于 2019-12-23 01:11:31
问题 I have a few MVC 5 applications that share the same authentication cookie. I'm using ASP.NET Identity to create the cookie. I checking if the user is authenticated using Owin's helper method, like so: app.UseCookieAuthentication( new CookieAuthenticationOptions { AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie, ExpireTimeSpan = TimeSpan.FromMinutes(expirationTimeInMinutes), LoginPath = new PathString("/Account/Login"), Provider = new CookieAuthenticationProvider() }); And in

identity server 4 windows authentication

柔情痞子 提交于 2019-12-22 17:54:30
问题 I have followed a combination of these three resources for getting started with Identity Server 4. IdentityServer4.Quickstart.UI 4_ImplicitFlowAuthenticationWithExternal Combined_AspNetIdentity_and_EntityFrameworkStorage The combination of the three were used in order to store users within the the database even from external providers. Also store Identity Server 4 configurations such as claims, roles, clients, and resources. My main issue right now is when running in IIS Express windows

Special language characters in username of ASP.NET Identity

心不动则不痛 提交于 2019-12-22 17:54:11
问题 I would like to use some special characters like ø in user name. But I am facing this error in IdentityResult result = UserManager.Create(applicationUser, password); Error: User name testø is invalid, can only contain letters or digits. How we can fix it? How to allow some special characters? 回答1: I found what do I have to do public class ApplicationUserManager : UserManager<ApplicationUser> { public ApplicationUserManager() : base(new UserStore<ApplicationUser>(new ApplicationDbContext())) {

Special language characters in username of ASP.NET Identity

谁说我不能喝 提交于 2019-12-22 17:53:05
问题 I would like to use some special characters like ø in user name. But I am facing this error in IdentityResult result = UserManager.Create(applicationUser, password); Error: User name testø is invalid, can only contain letters or digits. How we can fix it? How to allow some special characters? 回答1: I found what do I have to do public class ApplicationUserManager : UserManager<ApplicationUser> { public ApplicationUserManager() : base(new UserStore<ApplicationUser>(new ApplicationDbContext())) {