identity

Thread.CurrentPrincipal is authenticated but ClaimsPrincipal.Current is not

时光毁灭记忆、已成空白 提交于 2019-12-08 17:58:34
问题 I'm using Claims based Authorization in my WebApi project and have a method where I check if the current Identity is authenticated. When I use ClaimsPrincipal.Current the current Identity is not authenticated but when I use Thread.CurrentPrincipal it is. ClaimsPrincipal.Current.Identity.IsAuthenticated; //False Thread.CurrentPrincipal.Identity.IsAuthenticated; //True This seems strange especially since the MSDN says ClaimsPrincipal.Current just returns Thread.CurrentPrincipal: Remarks By

User.Identity.IsAuthenticated always false after PasswordSignInAsync gives success

落花浮王杯 提交于 2019-12-08 16:56:49
问题 I've got a standard MVC project, with the UserManager and SignInManager objects and an AccountController, with the pre-created login and register type functionality. I can register new users to my AspNetUsers table, but when I login I call:- var result = await SignInManager.PasswordSignInAsync(model.Email, model.Password, model.RememberMe, shouldLockout: false); The data is coming through from the form correctly, and the result is Success, which I expected. I then tried the following

ASP.NET Identity Integration when project is created with no authentication

放肆的年华 提交于 2019-12-08 16:22:58
问题 I have an issue with Identity and I am not very familiar with it. Not too long ago I started a new project that was originally not meant to have any authentication attached to it. However, as the project grew we found that we should implement it. Since it wasn't originally set up that way I created a form for a login. I found the answer to this question and implemented it: How to implement custom authentication in ASP.NET MVC 5 However it is not working and I do not know why. Here's my code:

Entity Framework 4.2 - How to realize TPT-Inheritance with Database-generated Primarykey Value?

淺唱寂寞╮ 提交于 2019-12-08 07:53:27
问题 I want to use the EF (4.2) in the following scenario: There exists a database already (so I chose the database-first approach) and it is a SQL Anywhere DB. I want to use persistence-ignorant business objects, so I use the DbContext Template to generate POCO classes from the EDM. There is one simple inheritance hierarchy among my entities: an abstract base entity and two concrete derived entities. In the database there is one table for each type of the inheritance hierarchy (Table-Per-Type

Identity Column not respected on Insert into() (Amazon Redshift)

帅比萌擦擦* 提交于 2019-12-08 07:35:55
问题 I initially ran into this when I was selecting from one table with an identity, primary key and sort key into another table with its own set of identity, primary, sort. Instead of respecting the (1,1) identity as it was defined, it doing (1,8) (sometimes 3,8). I think it might be because the original table was sorted? In trying to figure out what was going on, I made a much simpler query and data and found a reproducible example across multiple redshift clusters. Take this test example: drop

Why are there gaps in my IDENTITY column? [duplicate]

落花浮王杯 提交于 2019-12-08 07:29:28
问题 This question already has answers here : Why are there gaps in my IDENTITY column values? (7 answers) Closed 6 years ago . My table works fine if I enter data correctly - I can insert data and the IDENTITY values are 1, 2, 3, 4. However, if I make a mistake and get an error message, e.g. Cannot insert the value NULL into column 'x', table 'table'; column does not allow nulls. INSERT fails. The statement has been terminated. Then if I insert another row successfully, the IDENTITY value is 6,

Get email and display name from alias in Visual Studio Team Services

时光总嘲笑我的痴心妄想 提交于 2019-12-08 06:36:18
问题 is there any API in VSTS that's equivalent to IIdentityManagementService2 in TFS? I used ReadIdentity(https://msdn.microsoft.com/en-us/library/ff731745(v=vs.120).aspx) to get the email address and display name of an account alias in TFS. I am trying to do the same in VSTS, but I am not finding anything that can do similar things in its REST API or Microsoft.VisualStudio.Services.* libraries. 回答1: Yes, you can get it via Accounts and profiles in VSTS Rest API, the "Accounts" can get the

WSO2 Identity Server external LDAP throws OBJECT_CLASS for OID identityperson does not exist

帅比萌擦擦* 提交于 2019-12-07 23:52:54
问题 I am using the Identity Server 4.1.0 and also I am running an ApacheDS within the Apache Directory Studio. So what I want now is connect my IS to the external LDAP. IS is connecting fine to the ldap, only it throws errors because there are attribute-definitions missing. At least that is my interpretation of the stacktrace. I saw that other people tried it too: WSO2 external ldap not working But my error is different. Also I see how in this blog it is explained well how to use the Directory

How to unauthenticate current user ASP.net mvc Identity

一笑奈何 提交于 2019-12-07 18:05:18
问题 When a user goes to my site they get the login page. Once they successfully login they can logoff and a different user can login. However, if the user clicks the back button while logged in it goes to the login page. At this point a new user can no longer login. I receive an anti-forgery token error. I have tried to logoff any user that goes to the login page. I have tried different ways to logoff. I even tried to Session.Abandon(); Account controller: // GET: /Account/Login [AllowAnonymous]

SQL Server : create a column as an Identity that repeats a pattern

别说谁变了你拦得住时间么 提交于 2019-12-07 14:51:32
In SQL Server 2008 R2 I know how to create a primary key column that keeps my lines unique (column3 in my example below), but I also need a column that auto-fills a repeating set of integers (column2 in my example below). I don't know how to create a column like this. Searches suggest it can be done with "reseeding", but not sure how to actually a create this column or if its even possible to automatically do this. I'm looking for something like this, with Column2 being auto-filled every time a new line is created: Column1 Column2 Column3 name1 1 1 name2 2 2 name3 3 3 name4 4 4 name5 5 5 name6