asp.net-identity

prevent users without confirmed email from logging in ASP.Net MVC with Identity 2

懵懂的女人 提交于 2019-12-03 03:12:59
In microsoft Identity 2 there is ability to users can confirm there email addresses I downloaded Identity 2 sample project from here in this project there isn't any difference between users confirmed their emails and who doesn't I want to people how don't confirmed their emails can't login this is what I tried : public async Task<ActionResult> Login(LoginViewModel model, string returnUrl) { if (!ModelState.IsValid) { return View(model); } var result = await SignInManager.PasswordSignInAsync(model.Email, model.Password, model.RememberMe, shouldLockout: true); switch (result) { case SignInStatus

ASP.NET Identity + Windows Authentication (Mix mode - Forms + Windows)

僤鯓⒐⒋嵵緔 提交于 2019-12-03 03:01:20
问题 I have tried my best to search the web before asking this question. I've seen similar questions on stackoverflow, however, none has been answered satisfactorily for a long time now. This is one more attempt to get this recurring question answered. The Problem How to build an ASP.NET MVC 5 website which uses "Windows Auth" for Intranet users and "Forms Auth" for Internet users? We'd like to accomplish this using ASP.NET Identity. Moreover, we don't want to use Active Directory Groups for

UserCookieAuthentication in Mono 3.4.1

喜你入骨 提交于 2019-12-03 03:01:16
When ever I add the line below to my Startup class I get the exception below. This is a self hosted exe running from mono (Ubuntu). It works fine in windows. I've narrowed it down the UseCookieAuthentication call. I can instantiate the options without any issue. Any idea what is going on here? I have aspnet Identity working and EF6/MySql. app.UseCookieAuthentication(new CookieAuthenticationOptions()); Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeLoadException: Could not load type 'Microsoft.Owin

MVC 5: Should I inherit my User from IdentityUser class?

怎甘沉沦 提交于 2019-12-03 02:50:04
问题 I was trying to learn Asp.Net Identity and in this tutorial, Create an Entity Framework Code First ToDo model in Models\AppModels,cs part MyUser class inherits from IdentityUser class and MyDbContext inherits from IdentityDbContext<MyUser> class. Why is that? Lets say I have a User class that holds all the information of the user of my web application, should that class inherit from IdentityUser, and should my DbContext inherit from IdentityDbContext<User> ? Also, what are the advantages of

asp.net web form client with identity server 4

孤人 提交于 2019-12-03 02:24:40
I have a asp.net solution which consists of 1). asp.net identity server rc 3 2). asp.net Core web api 3). asp.net webform ( not in asp.net core, client) I don't see any sample with identity server 4 and web form client. Can you please suggest how to authenticate web form user using identity server with asp.net identity and then call api with the access token ? I don't see identity server 4 sample with web form client or sample identity server 3 has a sample but it is doing everything in startup When i see mvc client for identity server 4, it has all settings in configure method and then calls

Talking to IdentityServer4 with an Angular SPA application for authentication/authorization receiving a token then talking to Web API

大兔子大兔子 提交于 2019-12-03 02:03:23
I have an asp.net core Web API. I am currently making calls directly to it using an Angular 4 app. I now want to add authentication and authorization layer. I would like to do this by adding another project (strictly for auth) of type : ASP.NET Core MVC (w/ Individual User Accounts) to my solution and then adding IdentityServer4 to it. The plan is to use the existing Identity tables to store users, roles, etc. Once this is all setup I am a bit confused about how my Angular 4 SPA app or any other third party authenticates through the IdentityServer app. I would assume this then returns a token

Custom Membership with Microsoft.AspNet.Identity - CreateLocalUser fails

限于喜欢 提交于 2019-12-03 02:02:08
问题 I've been trying to implement a custom version of the new Identity features in ASP.NET 4.5 (Microsoft.AspNet.Identity), using Visual Studio 2013. After many hours of playing around with this, I've simplified my code in an effort to get it running without errors. I've listed my code below. When doing a Local Registration, the database tables are created, but the CreateLocalUser method fails. I'm hoping that someone can help me identify the changes needed. Models/MembershipModel.cs using

ASP.NET Identity Bearer Token vs JWT Pros and Cons

随声附和 提交于 2019-12-03 01:37:57
I have used ASP.NET Identity for a while now and have been looking at JWT (JSON Web Token) as they seem really interesting and easy to use. JWT.IO has a great example/tool of debugging the token. However, I'm not entirely sure how JWT's work on the back end, would you still use Identity? Also how do the tokens (Bearer vs JWT) compare? Which is more secure? JamesT JWTs are like a ticket to an attraction. It contains all the security information a server needs embedded in it. Once the server has handed it out the client just needs to present it whenever it asks for something and the server

app.UseOAuthBearerTokens with ASP.NET Identity 2.0's DbContext middleware?

£可爱£侵袭症+ 提交于 2019-12-03 00:51:22
Edit: After progressing, I can narrow the scope of the question: What changes should be made to startup.auth.cs and ApplicationOAuthProvider.cs in the VS2013 SPA template (using ASP.NET identity 1.0) in order to migrate it to use ASP.NET identity 2.0? Edit 2: I've simplified this question even further. How can one use app.UseOAuthBearerTokens with ASP.NET Identity 2.0's middleware for retrieving the DbContext? app.UseOAuthBearerTokens(new Microsoft.Owin.Security.OAuth.OAuthAuthorizationServerOptions() { //What goes here?? }); (There's no example of this in the sample that's available.) There

Save additional profile data during “Register” in ASP.Net Identity (MVC)

橙三吉。 提交于 2019-12-03 00:47:46
问题 I need to store additional information during user registration such as: First Name, Last Name and etc. My question has two parts: How can I save my additional information during Register? My current method throws error: Validation failed for one or more entities. See 'EntityValidationErrors' property for more details . I have already checked "Watch" inside VS and also used try-catch but it didn't help. Thanks in advance for your help! IdentityModels.cs public class ApplicationIdentityAccount