asp.net-identity

Too many OpenID.nonce cookies cause “Bad Request”

我怕爱的太早我们不能终老 提交于 2019-12-04 07:45:57
I have already gone through links here , here and here which are related to issue I am having. I have Silverlight application using IdentiServer3 for authentication and I started having this issue just now when I implemented log out functionality. Note that the issue has nothing to do with Silverlight because login and logout functionality is actually implemented on the server side which is a classic ASP.Net Web form. (.NET 4.5.1) The application never had logout functionality, so user just used to close the browser so we never encountered this issue before. We have now logout.aspx page and

IdentityUser in Data layer

好久不见. 提交于 2019-12-04 07:45:50
I am struggling with my design (or over-design) of a web project I am doing. I have a MyProject.Data, MyProject.Business, and MyProject.Web DLL's. My data layer (EF6 based) contains my entities, db context. My business layer contains my repositories (yeah maybe not a true repo pattern). I have added IdentityFramwork to the Web Project, and of cource it creates ApplicationUser. I already have a User POCO in my Data layer. I would like to move the Application user into the Data layer, so I can use it in conjunction with other entities. One way to do this is have my Data.User extend IdentityUser,

MVC 5 Identity 2.0 lockout doesn't work

巧了我就是萌 提交于 2019-12-04 07:38:36
I need to block a user permanently. I don't understand why this code is not working. This line UserManager.IsLockedOut(user.Id); always returns false instead of true . Maybe it's necessary to put this line UserManager.UserLockoutEnabledByDefault = true; in user registration stage? using (var _db = new ApplicationDbContext()) { UserStore<DALApplicationUser> UserStore = new UserStore<DALApplicationUser>(_db); UserManager<DALApplicationUser> UserManager = new UserManager<DALApplicationUser>(UserStore); UserManager.UserLockoutEnabledByDefault = true; DALApplicationUser user = _userService

How to Add another Propertys to User.Identity From table AspNetUsers in identity 2.2.1

心已入冬 提交于 2019-12-04 06:41:13
i Add some new property to asp.net identity 2.2.1 (AspNetUsers table) code first public class ApplicationUser : IdentityUser { public string AccessToken { get; set; } public string FullName { get; set; } public string ProfilePicture { get; set; } public async Task<ClaimsIdentity> GenerateUserIdentityAsync(UserManager<ApplicationUser> manager) { // Note the authenticationType must match the one defined in CookieAuthenticationOptions.AuthenticationType var userIdentity = await manager.CreateIdentityAsync(this, DefaultAuthenticationTypes.ApplicationCookie); // Add custom user claims here return

Connecting local users database with Identity Server 4

感情迁移 提交于 2019-12-04 06:38:46
问题 -> I want to use Identity server 4 as a central token generator for some clients. -> Here my problem is I have implemented Identity server 4 with the help of docs, in the docs the IS4 is using its own database for users to login. -> Can someone explain the way to connect to my own users database for login and token generation. (I'm using the latest version of IS4 and .net core). Thanks in advance :) Note: I have tried all the things from docs -> http://docs.identityserver.io/en/latest

asp.net mvc 5 entity framework 6 identity working with trust level = medium?

萝らか妹 提交于 2019-12-04 06:38:29
问题 Creating the simplest project (In visual studio 2013 -> asp.net web application -> MVC authentication with individual accounts), it works perfectly on localhost. However, when sending to the server (medium trust level), the project does not work when I try to enter login. See the error image: http://s18.postimg.org/fm2qw8gzt/print.png I tried to include on assembly.cs [assembly: AllowPartiallyTrustedCallers]. It did not work. I have created a strong name key. It did not work. The server does

ASP.Net Identity not persisting cookie MVC6 vNext

橙三吉。 提交于 2019-12-04 06:38:13
问题 I'm working on a MVC6 ASP.Net5 project, and am having trouble with .Net Identity persisting my authentication cookie on login. I am using a custom user store, this is an existing DB with existing stored procedures etc... My SignIn method is an extension on my User object, and follows. public static async Task SignIn(this UserModel Model, UserManager<UserModel> UserManager, SignInManager<UserModel> SignInManager, bool RemeberMe = true) { var Claims = new List<Claim>(); Claims.Add(new Claim(

Get custom claims from a JWT using Owin

我的未来我决定 提交于 2019-12-04 06:35:55
问题 I'm using Owin with JWTBearerAuthentication to authorize users and validate their tokens. I'm doing it like this: public class Startup { public void Configuration(IAppBuilder app) { HttpConfiguration config = new HttpConfiguration(); config.MapHttpAttributeRoutes(); config.Routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "api/{controller}/{id}", defaults: new { id = RouteParameter.Optional } ); ConfigureOAuth(app); app.UseWebApi(config); } private void ConfigureOAuth(IAppBuilder app) {

Register with username using identity 2.1

☆樱花仙子☆ 提交于 2019-12-04 06:22:19
问题 New .net identity system uses email and password as registration pair. I would like to change it as it was before and use username for loging users to my webapp. Also I'd like to keep somme additional information during registration as email, phone number. Can You help me and point where I should look for information for solving the problem. I cant find usefull information. 回答1: Actually the old identity framework system (v 1.0) registration UI different to the new version. You can easily

DynamoDB consistent reads for Global Secondary Index

江枫思渺然 提交于 2019-12-04 06:15:23
Why cant I get consistent reads for global-secondary-indexes? I have the following setup: The table: tblUsers (id as hash) Global Secondary Index: tblUsersEmailIndex (email as hash, id as attribute) Global Secondary Index: tblUsersUsernameIndex (username as hash, id as attribute) I query the indexes to check if a given email or username is present, so I dont create a duplicate user. Now, the problem is I cant do consistent reads for queries on the indexes. But why not? This is one of the few occasions I actually need up-to-date data. According to AWS documentation: Queries on global secondary