asp.net-identity

ApplicationUserManager's Generate ___ Token methods

◇◆丶佛笑我妖孽 提交于 2019-12-11 17:41:51
问题 I see there are 5 different Generate Token methods on ApplicationUserManager such as: manager. GenerateChangePhoneNumberToken () manager. GenerateEmailConfirmationToken () manager. GeneratePasswordResetToken () manager. GenerateTwoFactorToken () manager. GenerateUserToken () What is the point of GenerateUserToken when the other 4 exist? When would you only use GenerateUserToken and not any of the others? Can the UserToken from GenerateUserToken be used instead of the other 4 for all possible

How to remove default ASP.NET Core Identity endpoints?

风格不统一 提交于 2019-12-11 17:16:21
问题 Let's say I'd want to write my own Login, Logout endpoints and their Views But for some reason I'm struggling hard with removing an existing endpoints Whenever I remove things that probably are associated with those endpoints, then they recreate themselves and return their default Views. Basically I'd want to remove as much as possible default endpoints/views of those generated from ASP.NET Core Identity Any ideas on how can I acheive that? "Templates/Identity/Pages/Account/Account

ASP.NET Identity in MVC client using IdentityServer causes loop

懵懂的女人 提交于 2019-12-11 17:09:11
问题 I have an Asp.NET Core application that uses IdentityServer for authentication. This works fine. Now I want to use ASP.NET Core Identity in my application for managing roles, claims, etc. The documentation saysI should add service.AddIdentity ... for that. However, when I add that in my client to the Startup.cs, the login with IdentityServer no longer works. I will be redirected to IdentityServer, login and redirected back to the client (this works fine) However, then my client throws an

Identity Server 4 with EF Identity DB Issue

隐身守侯 提交于 2019-12-11 16:59:02
问题 I'm trying to setup an Identity Server 4 solution with EF Identity DB. The issue I'm having maybe with info stored in the Identity DB. Not sure if I have the client, API, Provision, Scopes... setup correct. This is my first attempt working with EF Identity DB. I can post DB info if it helps resolve the issue. I'm able to login and retrieve the Secure User Claim information, The Identity Server (Request from API) Token request validation and Token validation are successful. Log info below:

ASP.NET Core Identity and Identity Server 4 - [Roles, Claims and IdentityResources]

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-11 15:56:33
问题 I would like to ask you for clarification when integrating IdentityServer 4 with ASP.NET Identity. I am working with two database contexts. Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityDbContext<IdentityUser> and IdentityServer4.EntityFramework.DbContexts.ConfigurationDbContext . Identity Server 4 is using AspNetIdentity .AddAspNetIdentity<IdentityUser>() . So IdentityUser has assigned IdentityUserClaims and it's properly reflected in JWT token after successfull authentication.

Claims added to ClaimsIdentity getting lost in ASP.NET Core Identity System

旧城冷巷雨未停 提交于 2019-12-11 15:44:04
问题 In my ASP.NET Core Identity I have noticed that my claim that I add are getting lost . First I have a Create claim view having a form to create a claim. The claim is added to the currently logged in user . The code of the Action method is: [HttpPost] [ActionName("Create")] public IActionResult Create_Post(string claimType, string claimValue, string claimIssuer) { ClaimsIdentity identity = User.Identity as ClaimsIdentity; Claim claim = new Claim(claimType, claimValue, ClaimValueTypes.String,

using simple injector with aspnet.identity

狂风中的少年 提交于 2019-12-11 15:39:12
问题 I'm trying to use simple injector with my mvc project, and I'm unclear how to complete all registrations for framework code. In particular, with this aspnet.identity code.In general, since this isn't my code and the call stack is through .net library .dlls, is there a way to get simpleinjector to work with this aspnet.identity code. Examples: In case below, I can see from subsequent code the the generic class that is instantiated from the generic interface, however I don't know how to

Dynamic database connection using Asp.Net identity

与世无争的帅哥 提交于 2019-12-11 15:29:39
问题 I am working on a multi-tenant application that uses multiple databases. There is one master database that contains user information and then each tenant database also has their own users for that tenant (which are a subset of the users in the master database). The user will log in which will check the master database, then based on their details (i.e. which tenant they belong to) it will log them into the application using the user details on their tenant database. I am using the method

Assigning a user to a Role inside asp.net core will return this error “You do not have access to this resource.”

对着背影说爱祢 提交于 2019-12-11 15:21:33
问题 I created a new asp.net core web application which uses individual user accounts. now i am trying to implement a simple role assignment scenario. so i register a test user, where the user got added inside the AspNetUser table:- then i add a new Role named "Administrator" inside the AspNetRole:- then i added a new AspNetUserRole to link the user to the Role:- then i added the following Authorize annotation on the About action method:- [Authorize(Roles = "Administrator")] public IActionResult

ASP.Net Core MVC Identity with identityserver4

一曲冷凌霜 提交于 2019-12-11 15:19:28
问题 i have a few questions. I have a setup with an asp.net core application with identityserver4 and EF. that works fine. Now i want to know which way i have to store items in the database. i have seven tables for identity database: AspNetUSerRoleClaims - claims for roles (which roles has access to what) AspNetRoles - roles of the user AspNetUserClaims - claims of the user like firstname, country AspNetUserLogins - how to use this table? AspNetUserRoles - roles for users AspNetUsers - user stored