identity

IHttpContextAccessor.HttpContext.User.Identity shows all null properties in CurrentUserService service

谁都会走 提交于 2021-02-15 04:57:10
问题 I am trying to use Jason Taylor's Clean Architecture Template, this template uses NSwag to automatically create a TypeScript Client (Angular), but I don't need to create a TS client, so my main goal is to replace it with Razor Pages. I've been able to achieve this to a high grade, but I'm having trouble with the CurrentUserService whenever it gets instantiated it is supposed to set the UserId in this line: UserId = httpContextAccessor.HttpContext?.User?.FindFirstValue(ClaimTypes

IHttpContextAccessor.HttpContext.User.Identity shows all null properties in CurrentUserService service

我的梦境 提交于 2021-02-15 04:54:09
问题 I am trying to use Jason Taylor's Clean Architecture Template, this template uses NSwag to automatically create a TypeScript Client (Angular), but I don't need to create a TS client, so my main goal is to replace it with Razor Pages. I've been able to achieve this to a high grade, but I'm having trouble with the CurrentUserService whenever it gets instantiated it is supposed to set the UserId in this line: UserId = httpContextAccessor.HttpContext?.User?.FindFirstValue(ClaimTypes

How to cast UserStore<IdentityUser> to its base class IUserStore<IUser>?

寵の児 提交于 2021-02-11 07:10:37
问题 I am trying to use the new asp.net identity provider with my abstraction layer of my models domain, wich have a implementation of Entity Framework, so I would like to use the out of box version of identity with entity framework in my data access layer. How can I convert an UserStore<IdentityUser> to its base interface IUserStore<IUser> Once UserStore is an implementation of IUserStore, I can get the cast by this: UserStore<IdentityUser> as IUserStore<IdentityUser> But I want to avoid the

Using @@identity or output when inserting into SQL Server view?

和自甴很熟 提交于 2021-02-08 03:43:04
问题 (forgive me - I'm new to both StackOverflow & SQL) Tl;dr - When using @@identity (or any other option such as scope_identity or output variable), is it possible to also use a view? Here is an example of a stored procedure using @@identity : --SNIP-- DECLARE @AID INT DECLARE @BID INT INSERT INTO dbo.A (oct1) VALUES (@oct1) SELECT @AID = @@IDENTITY; INSERT INTO dbo.B (duo1) VALUES (@duo2) SELECT @BID = @@IDENTITY INSERT INTO dbo.tblAB (AID, BID) VALUES (@AID, @BID) GO Longer: When inserting

Using @@identity or output when inserting into SQL Server view?

穿精又带淫゛_ 提交于 2021-02-08 03:42:30
问题 (forgive me - I'm new to both StackOverflow & SQL) Tl;dr - When using @@identity (or any other option such as scope_identity or output variable), is it possible to also use a view? Here is an example of a stored procedure using @@identity : --SNIP-- DECLARE @AID INT DECLARE @BID INT INSERT INTO dbo.A (oct1) VALUES (@oct1) SELECT @AID = @@IDENTITY; INSERT INTO dbo.B (duo1) VALUES (@duo2) SELECT @BID = @@IDENTITY INSERT INTO dbo.tblAB (AID, BID) VALUES (@AID, @BID) GO Longer: When inserting

Using Identity and roles in web-forms in asp.net 4.5.1

前提是你 提交于 2021-02-07 14:31:31
问题 I am trying to find a good walkthrough or example of how to use the new Identity authorization system with added roles. When you create a new website in VS 2013 there is also an Account folder and in the database you have the tables also connected to roles. But all examples available are connected to MVC! Does anybody have a link to a good Identity users or programmers guide that does not use MVC? Looking forward to any proposal in this matter. 回答1: Here is an excellent step-by-step

How to compare the identity of maps OR what's going on in this example?

假装没事ソ 提交于 2021-02-04 20:38:12
问题 I'm trying to compare the identity of 2 maps package main import "fmt" func main() { a := map[int]map[int]int{1:{2:2}} b := a[1] c := a[1] // I can't do this: // if b == c // because I get: // invalid operation: b == c (map can only be compared to nil) // but as far as I can tell, mutation works, meaning that the 2 maps might actually be identical b[3] = 3 fmt.Println(c[3]) // so mutation works... fmt.Printf("b as pointer::%p\n", b) fmt.Printf("c as pointer::%p\n", c) // ok, so maybe these

How to compare the identity of maps OR what's going on in this example?

烈酒焚心 提交于 2021-02-04 20:37:50
问题 I'm trying to compare the identity of 2 maps package main import "fmt" func main() { a := map[int]map[int]int{1:{2:2}} b := a[1] c := a[1] // I can't do this: // if b == c // because I get: // invalid operation: b == c (map can only be compared to nil) // but as far as I can tell, mutation works, meaning that the 2 maps might actually be identical b[3] = 3 fmt.Println(c[3]) // so mutation works... fmt.Printf("b as pointer::%p\n", b) fmt.Printf("c as pointer::%p\n", c) // ok, so maybe these

How to compare the identity of maps OR what's going on in this example?

好久不见. 提交于 2021-02-04 20:36:30
问题 I'm trying to compare the identity of 2 maps package main import "fmt" func main() { a := map[int]map[int]int{1:{2:2}} b := a[1] c := a[1] // I can't do this: // if b == c // because I get: // invalid operation: b == c (map can only be compared to nil) // but as far as I can tell, mutation works, meaning that the 2 maps might actually be identical b[3] = 3 fmt.Println(c[3]) // so mutation works... fmt.Printf("b as pointer::%p\n", b) fmt.Printf("c as pointer::%p\n", c) // ok, so maybe these

How to duplicate an ASP.NET MVC project and make it not accept authentication cookies from the original application?

。_饼干妹妹 提交于 2021-01-29 13:54:03
问题 I duplicated an ASP.NET MVC project and renamed all the namespaces to the new project name. But now, if I log into the original application, and immediately navigate to the duplicated application, the dupe application accepts the authentication cookie and allows me through. They are hosted on the same domain. The applications use ASP.NET Identity for authentication. Is there a unique application key or something like that that needs to be changed in the duplicated application so that it does