Questions tagged [identity]

1

votes
1

answer
173

Views

Where is the ClaimsIdentity information stored after calling AuthenticationManager.SignIn() using CookieAuthenticationProvider

We are using the Microsoft.Owin.Security.Cookies.CookieAuthenticationProvider in an ASP.Net MVC web application. The 'sign in' code uses a custom class that keeps track of authorization info (userRights in the example below). The code looks like this: string auth = JsonConvert.SerializeObject(userRi...
Louis Somers
1

votes
2

answer
494

Views

Change Id type of asp.net core 2.2 IdentityUser

I'm new to dot-net core 2.x, so... I would like to change the type of the Id in asp.net core 2.2 IdentityUser from string to int. All the examples I've found via google (and the stackoverflow search facility) are giving me examples of asp.net core 2.0 which provides an ApplicationUser when you scaff...
Owen
1

votes
1

answer
454

Views

ASP.NET Core 2.1 Role Manager Register

In my seeding code I create Users and Roles, and the error seems to be whenever I run it through startup I seem to be getting 'No service for type Microsoft.AspNetCore.Identity.RoleManager'1[Microsoft.AspNetCore.Identity.IdentityRole] has been registered. EDIT*** I think the issue is that the code...
OCTAVIAN
1

votes
2

answer
58

Views

Why does OAuth fail when using ASP.NET Identity Core?

I have an ASP.NET Core 2.x project with the following configuration: services .AddAuthentication(options => options.DefaultScheme = CookieAuthenticaitonDefaults.AuthenticationScheme) .AddCookie(CookieAuthenticationDefaults.AuthenticationScheme) .AddFacebook(ConfigureFacebook); Predictably, when I ca...
Jesse Hallam
1

votes
2

answer
58

Views

How can i change existing column as Identity in PostgreSQL 11.1

I would like to changes my existing column as Auto Identity in a Postgres Database. I tried with below script but it won't worked. Let me know if you have solution for the same I don't want to use postgres SEQUENCE. I would like to use GENERATED ALWAYS AS IDENTITY. ALTER TABLE public.patient ALTER...
Nayan Rudani
1

votes
2

answer
179

Views

Does submit button passes its value to action method, on form submit?

Update: What are the control/fields whose value would be submitted when the form is post back? In an ASP.NET MVC Form, if user double clicks on the submit button, the form would be submitted two times. In order to solve this problem I implemented the solution explained here. This is my solution, wh...
Hooman Bahreini
0

votes
0

answer
11

Views

Can't commit a new file

I am using Linux OS on Chromebook. I'm learning Java. I downloaded a repository from GitHub. It lacked of .gitignore file, so I created it and I'm trying to commit it, but I get a message ''' *** Please tell me who you are. Run git config --global user.email '[email protected]' git config --global use...
user944047
0

votes
0

answer
18

Views

How to integrate Social Login with existing .Net core Web API backend and Angular SPA frontend with working OpenIddict user/password and bearer token

TL;DR Question: how to implement social login (OAuth2 authorization flow) with an existing SPA/Web API application that is based on identity, user/password, bearer token authentication? I have an existing application that has: Backend: .Net Core 2 Web API with Identity and OpenIddict services config...
Fernando Ribeiro
0

votes
0

answer
5

Views

Mistake with my code same id but multiple in 2nd table how to get each separate

So I have a user that can create multiple time sheets at a time each if a user creates a timesheet and creates more than 1 project at 1 time it will create separate timesheetdetails for each project but they will all have the same timesheetmaster. How can I specifically pick each timesheetdetail whe...
Bigbear
0

votes
0

answer
15

Views

Need to display certain values stored in the AspNetUser table

I'm using the code below to see if I can display the values of Description, Quantity, Price and Value stored in the AspNetUser table as can be seen. My first attempt in the 2nd 'IF' does not yield that apart from the userid. I went ahead to add the last three lines but the 'string' in the last line...
Ugochukwu Unamka
1

votes
1

answer
223

Views

Where does ASP.NET Identity store information about external authentication provider?

In my ASP.NET MVC application, I have enabled authentication using Microsoft and Google accounts. They both are working fine. i.e., I am able to login to my application using my hotmail and gmail both accounts. Once logged in (say, using Microsoft account), I am able to see following screen as well...
Nirman
1

votes
1

answer
507

Views

Combine ASP.NET MVC and Web API projects using identity

I am new to ASP.NET and I have to create an ASP.NET MVC project using the identity framework for authentication and authorization, but the access to the database (SQL Server) must be done in an independent web service project so I created a Web API project with also identity containing all services...
sam
1

votes
0

answer
171

Views

How to quickly sign out all the users in an ASP.NET MVC application via Identity?

While the answer here is fine for one or a couple of users: ASP.net Identity 2.0 Sign-out another user it does not really scale, it can take a lot of time: https://msdn.microsoft.com/en-us/library/dn497517(v=vs.108).aspx I am thinking about SignalR forcing a refresh on the client and making a tempor...
Ehouarn Perret
1

votes
1

answer
861

Views

Database connection not created in IdentityDbContext

I'm trying to authentication Asp.Net Core 2 Web API with Asp.Net Identity 2. Here's my code for the AuthController and the databasecontext: public AuthController(UserManager userManager, SignInManager signInManager, RoleManager roleManager , IPasswordHasher passwordHasher, IConfiguration configurati...
devC
1

votes
1

answer
600

Views

How Create Guid-string for id column in c#

When I was looking at the asp.net Identity 2 sample, I found an interesting point. The point here is that using the Guid in the id column.when i to table definition (example: AspNetRoles table) I saw the command below: CREATE TABLE [dbo].[AspNetRoles] ( [Id] NVARCHAR (128) NOT NULL, [Name] NVARCH...
arman
1

votes
1

answer
220

Views

Issue bearer token from IdentityServer4

Is it possible to generate manually bearer token and return it if user is logged in successfully? Here's my point of view: [HttpPost] [AllowAnonymous] [ValidateAntiForgeryToken] public async Task Login2(LoginViewModel model) { if (ModelState.IsValid) { var result = await _signInManager.PasswordSignI...
Cieja
1

votes
0

answer
168

Views

Expose ASP.NET Identity via LDAP interface (.NET Core 2.0)

I have an ASP.NET Core 2.0 application where I am using the stock implementation of ASP.NET Identity to manage and authenticate my users. I would like to use my application as an identity provider for 3rd party service that I am planning on using. The only issue is that this service can only communi...
1

votes
0

answer
58

Views

Connect Unauthenticated Federated Identity ID with User Pool

I'm trying to implement an option in Mobile app (Xamarin) for users to be able to login into App as a guest user. Right now I'm able to obtain the Federated Identity ID for a guest user. It has a form of AccessKey/SecretKey/Token. I'm struggling with translating that credentials to accesToken and r...
Taier
1

votes
1

answer
222

Views

ASP.net core identity 2.0: proper way to use claims identity with db lookup?

I'm new to the concept of claims-based identity so if the question is unclear, please let me know. I've got a derived user collection, and it relates to an 'organizations' collection. A user can be an admin in related organizations. I'm trying to build the ability to have an [IsAdminForThisOrg] attr...
BenjiFB
1

votes
0

answer
53

Views

Asp.Net Identity Doesn't Remember Logged User

I've an ASP.MVC application with Asp.Net Identity. I want to keep logged user's session for one year. I set cookie expire to for one year but the application ask user name and password after a few days. I don't want the application ask login information again. What can i do? app.UseCookieAuthentica...
Yargicx
1

votes
0

answer
162

Views

ASP.net Identity management with Azure, in Web Form

I have a Webform ASP.net (in VB.net) that I want to add identity management too. I have added code that allows for the registration of users. But, I am stuck on how to log a user in. My application uses SSO with Azure Active Directory. What I would like to do is, after the user Authenticates wit...
jason
1

votes
0

answer
261

Views

Anti Forgery cookie issue after signout from IdentityServer4

I am developing a solution with IdentityServer4 and ASP.NET Core 2.0.5. After logging out using HttpContext.SignOutAsync, the user can go on the login form again and try to login. However, the error message I get after form post in the console is: The antiforgery cookie token and request token do no...
Gorgi Rankovski
1

votes
1

answer
790

Views

Role authorization in .net core 2.0 using Identity

I am using .net core 2.0 and trying to do authorization using asp identity in a mvc website. (Authentication is done using Google OAuth). Authentication is working fine i.e users can access controllers/views after logging in through google. But when I try adding a role('Admin') to a particular contr...
vicky99
1

votes
0

answer
181

Views

UserManagerExtensions methods changing System.Security.Principal.WindowsIdentity

we are using Identity 2 with MVC 5 for our web project. Requirement is to be able configure impersonated user for web application in web.config like so We implemented custom UserManager and configured authentication like this: public partial class Startup { public void ConfigureAuth(IAppBuilder app)...
Peter Kavecansky
1

votes
1

answer
159

Views

Using 2FA for password reset

My application uses Asp.Net Identity and sends a Two Factor code to my Auth app on login. This is pretty standard (as there lots of examples on the net) and uses the SendCode() method. My understanding is that the 'magic' is done by this line: // Generate the token and send it if (!await SignInMan...
Shak
1

votes
0

answer
201

Views

Adding multiple identities to ClaimsPrincipal in MVC4

In my MVC4 application there are two ways of logging in; as a customer, or as a back office administrator. At the moment, if you log in as either of these, the ClaimsPrincipal is replaced with a brand new one containing the single identity of the new login. It's currently impossible to be logged in...
David Omid
1

votes
1

answer
58

Views

How to check user roles in View MVC5

As the question says, I am trying to check for a user object's roles in MVC5 View. Basically what my view does is a listing of all the registered users and their current role. Here's my view: @model IEnumerable @{ ViewBag.Title = 'Talent Center Institute: Usuarios'; ViewBag.Menu = 'Usuarios'; ViewB...
l_degaray
1

votes
1

answer
121

Views

SharpArch.Domain.PreconditionException: 'An ISessionStorage has not been configured'

I tried to build ASP.NET Identity project with hibernate SharpArch.Domain.PreconditionException: 'An ISessionStorage has not been configured' https://github.com/Streamc/IdHiber I borrow code from https://github.com/nhibernate/NHibernate.AspNet.Identity/tree/master/source/NHibernate.AspNet.Web proje...
ifooi
1

votes
0

answer
669

Views

ASP .NET Identity - How To Validate Auth Token In Custom Filter Attribute

I have a question about verifying an Auth Token. Currently, I'm generating my Auth Token at /token and sending it back to the client side where I store it in session storage. To make the process as secure as possible I'm looking to store the token in a HttpOnly and Secure cookie to protect against...
DevEng
1

votes
2

answer
648

Views

soft delete in asp.net identity

I'm new to asp.net. How to store the value of IsDeleted to database? [HttpPost, ActionName('Delete')] [ValidateAntiForgeryToken] public async Task DeleteConfirmed(string id) { if (ModelState.IsValid) { var user = await UserManager.FindByIdAsync(id); //set IsDeleted to true user.DeleteUser();...
Ahmed
1

votes
1

answer
195

Views

SignInStatus always returns Success on TwoFactorAuthentication is enabled in webapi using asp.net identity

I am implementing 2 factor authentication in WebApi, asp.net identity and OWIN. Every time I log in, I get SignInStatus = Success never reaches to SignInStatus = RequiresVerification though user TwoFactorAuthentication is enabled. Below are some code snippets, Startup.cs: private void ConfigureAuth...
shailesh
1

votes
0

answer
64

Views

ASP.NET Identity not being able to login

I am working to give an admin the option of adding new users to my website, using ASP.NET Identity. My idea is that I have a link in my layout that redirects me to the account/register view if (User.IsInRole(RoleName.IsAdmin)) { //this is just for the admin //other links @Html.ActionLink('Add assist...
jdodle
1

votes
0

answer
365

Views

password History for Identity Core

is there any default implementation for password history? i'm trying to implement that feature on my project with identity so i have added password history table which contain password hashes. when user change password usermanager generate hash for password. var passwordHash = _userManager.PasswordH...
Gayan
1

votes
1

answer
242

Views

How to refresh the identity server token?

I'm generating token in the login time var identityService = await DiscoveryClient.GetAsync('http://localhost:5000'); // request token var tokenClient = new TokenClient(identityService.TokenEndpoint, 'ro.client', 'secret'); tokenResponse = await tokenClient.RequestResourceOwnerPasswordAsync(user.U...
Sathiya moorthi
1

votes
0

answer
185

Views

Integration with Multiple identity providers with Office 365

I wanted to know whether i can integrate multiple IDPs with O365 suite. I have already integrated O365 with Azure. we need to have Okta integration with O365. i am not sure whether this is feasible
harpreet
1

votes
0

answer
131

Views

Multi Tenant authentication middleware

Im looking for the best approach for supporting multi-tenancy when your identity server has a URL per tenant. This is a problem for me because im using the aspnet/security middleware and you obviously need to set the token endpoint etc at startup. Im effectively looking to resolve the host at runtim...
Christo
1

votes
0

answer
184

Views

Retrive randomly generated session id coockie name asp.net

I want to change asp.net ASP.NET_SessionId cookie name with some randomly generated string and also hash it's value. I've done both, But the problem is that i don't know how to get the `ASP.NET_SessionId and check if the hashed value is valid or not. The purpose is to prevent session hijacking. app....
Hadi Mohammadi
1

votes
1

answer
1.4k

Views

Use Authorize Attribute with Custom Claims based Authentication

I want to build my own authentication process using Claims based authentication in my ASP.net MVC project. I want to be able to use the Authorize attribute (including roles), for example [Authorize(Roles='admin')] and [Authorize(Roles='Frontenduser')] as I will have multiple types of users. I don't...
dan
1

votes
0

answer
121

Views

Mapping, updating and working with claims in general

When working with claims in web apps (or any type of app actually) we typically use claim types to find and retrieve claims either from the token or from the datastore. After working with claims for a while I figure it is a bit cumbersome to deal with types but don't know what the alternatives are....
mare
1

votes
0

answer
34

Views

ASP Identity: Eager loading for User

I have added a propertry to IdentityUser named ClientID that related properly to table Clients by FK. Now i want to retrive user with his client name (from Clients table). How do i create Include function for that in context.Users? public ActionResult Users(string filter = 'all') { context = new Ide...
shdr

View additional questions