Questions tagged [asp.net-identity]

The ASP.NET Identity system is designed to replace the previous ASP.NET Membership and Simple Membership systems.

0
votes
0answers
5 views

Verifying Google Authenticator code not valid; asp.net identity

I followed the course "Asp.Net Identity Deep dive" on Pluralsight. In one module he shows how you can implement an Authenticator. I followed his instructions but the my token validation is still ...
0
votes
0answers
6 views

Cannot use table 'AspNetRoleClaims' for entity type 'IdentityRoleClaim<string>

I have generated Entityframework by DbFirst approach for an exisitng Db and when running the project it keeps getting an error as "Cannot use table 'AspNetRoleClaims' for entity type '...
0
votes
0answers
11 views

How to Enable External Login for specific Company Id using asp.net mvc identity

I have an application which is multi tenant based. When i login to my application. There are three fields tenant name, username and password. Now i want to use the external login for specific tenants. ...
1
vote
2answers
25 views

AspNet Identity - Custom IdentityRoleClaim & IdentityUserRole & IdentityUserClaim that duplicated foreign key

currently, I am using AspNetCore and the configuration dbcontext as below: public class AppDbContext : IdentityDbContext<ApplicationUser, ApplicationRole, string, ApplicationUserClaim, ...
0
votes
0answers
27 views

IdentityServer 4 User Registration - Where to place it?

I have an Angular 7 app that talks to IS4 via the oidc-client and also talks to a secured API. Everything is fine from the login and interaction point of view, however I wanted to implement user ...
1
vote
0answers
22 views

MVC Identity - Separation of Concerns [duplicate]

I am battling with a problem that I am sure is very simple but for some reason my tired (and old) brain cannot work out. I am creating an application that connects to an existing SQL database that ...
0
votes
1answer
18 views

How determine if user has enabled Authenticator

I am working on an ASP.NET Core 3.0 Application which uses the Identity Framework to authenticate users. Datasource is an MS SQL Server database. As two factor authentication, the default MS ...
0
votes
1answer
17 views

Pass identity generated ID to the next page in view as query string parameter through controller

I have a controller function, that adds data to the database, I am passing the data to a view which contains the details of the form submitted. I would like to pass the Identity ID generated as query ...
1
vote
0answers
12 views

MVC5 query to set IDENTITY_INSERT for non PK column and add record

I have the default identity asp.net database. I added some columns/properties to my user. One of my columns uses the IDENTITY property in my SQL. When I go to add a new user I get this error. 'Cannot ...
0
votes
0answers
11 views

How do I use Role-Based authentication in Asp.net Web Api Indentity

How do I use role based authentication based of what I currently have in my MVC application where in I already have roles using Identity Framework. I need this for my login so basically the token but ...
3
votes
0answers
61 views
+50

ASP.NET Core 2.2 - Password reset not working on Azure (Invalid token)

I have an ASP.NET Core 2.2 application running on multiple instances on an Azure Web App; it uses EF Core 2.2 and ASP.NET Identity. Everything works fine except the Password Reset flow where a user ...
0
votes
0answers
26 views

After add-migrations and database update, could see the structure of the table despite exists. AspNetCore-Identity [duplicate]

I am working on the Asp Net Core MVC app that I used AspNetCore Identity to create the user login/register/logout functions for my web-app project. I used AspNetCore Identity to create ...
0
votes
1answer
23 views

ASP.NET Core + Identity: the token cannot be unprotected after a certain time

We have an ASP.NET Core application using identity to deal with user identification. There is something wrong that happens when the user wants to confirm his /her email. In the Startup....
0
votes
0answers
17 views

Updating an Identity user record creates new record for navigation item

I have a 'fairly standard' Entity Framework with Identity set up where I have added a foreign key navigation property for a users address. When I come to update the record, the address item is added ...
0
votes
0answers
28 views

Using .net project DB in .net core project

I have a project in .net framework having a DB with details of many users.It uses .net Identity for managing users. Now, can I use this same DB for another project in .net core having Identity? Did ...
0
votes
0answers
16 views

MVC5 added Identity user props new column with identity error

I have the default identity asp.net database. I added some columns/properties to my user. One of my columns uses the IDENTITY property in my SQL. When I go to add a new user I get this error. '...
0
votes
0answers
10 views

MVC5 Identity: Get user modified field value

I have configured original identity model to meet my requirement, the modification looks like this: public class ApplicationUser : IdentityUser { public workshop workshop { get; set; } ...
1
vote
1answer
25 views

ASP.net Identity - get collection of users in “admin” or “adminlower” roles

I can get a collection of all users and order them with some Linq like this: var Users = UserManager.Users.ToList().OrderBy(x => x.DateCreated) I'd like to restrict users returned to those with ...
0
votes
1answer
14 views

Create roles Identity framework

I have a problem with creating a role for users. I follow the guide below. https://gooroo.io/GoorooTHINK/Article/17333/Custom-user-roles-and-rolebased-authorization-in-ASPNET-core/32835#.XOBFAcgzbcs ...
0
votes
1answer
21 views

How to eagerly load City From IdentityUser .Include Method not working

I'm working on a project Wedding Hall website in Asp.net MVC. I'm building API using Asp.net web API. For authentication and authorization I'm using Asp.net identity. I have learned something about ...
0
votes
0answers
7 views

Aspnet core netcoreapp2.2 Identity SignInManager.IsSignedIn(User) returns false when true

On the _LoginPartial.cshtml view the SignInManager.IsSignedIn(User) returns false even though the login was successful when using Firefox. I am using Windows 10 and Visual Studio 2019. Target ...
0
votes
2answers
37 views

How to register Handlers when implementing CQRS with Aspnet Core Identiy

I am trying to register, my users, using CQRS. I am registering MediatR: services.AddMediatR(typeof(MyCommand).GetTypeInfo().Assembly); public class Handler : IRequestHandler<RegisterCommand, ...
0
votes
2answers
38 views

.Net Core auto-generated string primary key

.Net Core 2.2 Identity framework has string primary key which is an auto-generated GUID. My question is how to have an auto-generated STRING primary key using Entity Framework 2.2?
-1
votes
0answers
29 views

Asp.Net Core Identity User.IsInRole always true

We are using Roles in a web application. In this application, we have admins who can remove/add roles to users dynamically. This works well, with one exception. We have UI elements that render ...
-1
votes
0answers
43 views

Is there any better/alternative to asp.net core identity or IdentityServer to Implement JWT Authentication And Authorization in asp.net core?

I'm creating a new asp.net core webapi project and I need to use Entity framework core Database first and Dapper. So I cannot use asp.net core identity and I don't need an IDP like IdentityServer. I ...
-1
votes
1answer
43 views

Linq with ef core

how can I use identity tables in asp.net core like AspNetUsers with Linq technique for example var x = (from a in db.table1 join b in AspNetUsers .... )
0
votes
0answers
6 views

User_Logins_Target: : Multiplicity is not valid in Role

I have an application that has been running for years (5 at least) and it has been working fine. I have come to update an Entity (Email) which looks like this: public class Email { public int Id {...
0
votes
1answer
46 views

How to make small password reset token in asp.net web api?

I was sending password reset token in user's email with the default GeneratePasswordResetToken method but it was quite big like 200 to 300 characters long. I want to make smaller tokens like 5/6 ...
-4
votes
0answers
27 views

How to get message from Post API 400 bad request error from angular?

I am using Angular 6 and ASP.Net Identity API. When I have login then I have pass some message from ASP.Net to Angular like username is not valid, user name already used, etc. I have set the ...
0
votes
1answer
24 views

IdentityServer4 System.ArgumentNullException: Value cannot be null. Parameter name: type when trying to refresh token

I have identityserver4 v2.4 setup to user ASP.Net Identity and Entity Framework as an operational store. When I call tokenClient.RequestRefreshTokenAsync(oldRefreshToken); as follows, I always get an ...
0
votes
2answers
22 views

Asp.net identity searching for email in username column in database

I am trying to use email for login authentication in asp.net identity, So I've created a username field in register form, but when I try to login I get an error invalid login attempt. So In asp.net ...
0
votes
1answer
29 views

Change email workflow in ASP.NET Core

If a user wants to change to a new email address, I use: var token = await _userManager.GenerateChangeEmailTokenAsync(user, newEmail); ...and send a confirmation mail which includes this change ...
0
votes
1answer
37 views

How create two difference table with IdentityUser

Project in a core 2.2 I have two classes which inherit IdentityUser first of them public class DeveloperModel : IdentityUser { [Required(AllowEmptyStrings = false)] public string FirstName ...
0
votes
0answers
6 views

One login but two user registry (two ADs)

I need some advice regarding if it is a good idea to have one single credentials (username/password) for a user in an organization that has two Active Directories. Some of users exist in both ADs (...
0
votes
1answer
42 views

How to add more than one identity store in aspnet core identity? [duplicate]

I'm currently adding ASP.NET Core Identity with IdentityServer4. I've added the identity similar to the line below. services.AddDbContext<PublicApplicationDbContext>(options => ...
1
vote
1answer
63 views

How to authorize actions with the [Authorize(Roles)] attribute?

I am trying to create a simple Web API with a controller based on a single model class. I've added AddIdentity in the Startup.cs, created two user roles and tried to authorize an action in the ...
0
votes
2answers
18 views

Redirect to login page in asp.net core idenity in ViewComponent

I am trying to make my viewcomponent accessible only if user is logged in. I am checking if user is not authenticated then redirect to login page but following code is giving me error public ...
0
votes
0answers
16 views

Identity Server 3 with Angular 7 - Just checking a fact

I have been asked to look at an existing project that uses Angular 7, .net core api's and Identity Server 4. the task is to retrofit this so it can actually auth against our identity server 3. (using ...
0
votes
1answer
48 views

Load Balancer breaks external login, because redirect uri is http (not https)

I am using ASP.NET MVC, and I am using MS built-in template to allow users to login with Facebook and Google, external ID. The external ID does not work on my Production environment (works on Test) ...
1
vote
1answer
27 views

How to Extend Roles for Multiple Locations / Sites with Asp.Net Core Identity

I have an API that is used in a multi-site/multi-location environment. At the moment, each user has roles defined but is locked to only one location. I am needing to extend this out to where a user ...
0
votes
1answer
34 views

ASP.NET Core Bind external login with IdentityUser without Razor Pages

I'm trying add GitHub authentication to my ASP.NET Core app so that certain users have administrator role. This role I want implement through IdentityRole and users should be stored as IdentityUsers. ...
1
vote
0answers
42 views

.NET Core Identity UserManager always returning null for user [duplicate]

I am currently trying to hook up Identity's UserManager class to a simple application. When trying to do so, .FindByEmailAsync as well as any other method to try to find users is always returning me a ...
0
votes
0answers
23 views

Receiving ObjectDisposed Exception when trying to add a Role to a User

I am trying to add an existing role to an existing user and receiving the following error: System.ObjectDisposedException: 'Cannot access a disposed object. A common cause of this error is ...
-3
votes
0answers
35 views

How we can access the Account controller and its views inside asp.net core project. and is it a recommended appraoch to modify them

I have created a new asp.net core 2.2 web application and i select to use the individual accounts for authentication. now when i run the application >> click on register >> i will be redirected to ...
0
votes
0answers
9 views

ASP.Net identity service will not connect to SQL Server 2017

Our application has been working correctly for the past 2 years on SQL Server 2012 and then recently we decided to upgrade to SQL Server 2017. After the upgrade we are not able to log into our ...
0
votes
0answers
31 views

.net core authorization using role based attributes isn't working

I have .Net core authorization set through user roles. I have the authorize attribute set at the page level restricted by roles, and I have a method restricted by only one role. I am using ajax ...
0
votes
0answers
17 views

Customize Register with selectlist in ASP.NET Core 2.2

Following a tutorial I have customized my Identity and added a first name, last name and departmentID. I' like to show a selectlist on the Register View with all the departments. I want to populate ...
0
votes
1answer
59 views

IdentityServer4 How can I redirect after login to the revious url page without registering all routes at IdP

As recommend I would have register the authorize callback url/redirect_url at IdP, which it works. But what if a client using MVC app tries to access a page with an unauthorized state, will be ...
0
votes
0answers
19 views

How to make Account and Manage controllers inherit from a BaseController without errors

I've made a custom controller called BaseController and I'm making all my controllers inherit from that one. This controller is useful for changing header color, adding custom texts, logos, etc. and ...
0
votes
1answer
17 views

JwtAuthentication disabled Identity login

So I added Jwt Authentication to my ASP.NET Core project. The project has two ways of interaction: 1) Directly using the webservice. Uses MVC controller to access and move things around. 2) ...

http://mssss.yulina-kosm.ru