asp.net-identity

Store user data in auth server or resource server? Or both?

痞子三分冷 提交于 2021-02-18 11:33:30
问题 This is my first time setting up OpenID Connect with IdentityServer 4 and AspNetIdentity and I was hoping someone could demystify the part about storing user data. What I've read so far is that user data should be stored in the Auth db that is connected to the auth server, but I'd really like to store user data in the resource db too that is connected to the resource server. I currently have a data model that looks like this: I have omitted many of the fields for both User and Event, but you

Invalid state cookie. An error was encountered while handling the remote login. ASP.NET Core MVC external social login

旧时模样 提交于 2021-02-16 09:37:29
问题 While implementing external social login in ASP.NET Core2.2 MVC web application without ASP.NET Core Identity. I am getting below error while redirecting back to the application after successful sign in with Google, Facebook, Twitter, LinkedIn and Microsoft. An unhandled exception occurred while processing the request. Exception: Invalid state cookie. Unknown location Exception: An error was encountered while handling the remote login. Microsoft.AspNetCore.Authentication

Invalid state cookie. An error was encountered while handling the remote login. ASP.NET Core MVC external social login

喜夏-厌秋 提交于 2021-02-16 09:37:06
问题 While implementing external social login in ASP.NET Core2.2 MVC web application without ASP.NET Core Identity. I am getting below error while redirecting back to the application after successful sign in with Google, Facebook, Twitter, LinkedIn and Microsoft. An unhandled exception occurred while processing the request. Exception: Invalid state cookie. Unknown location Exception: An error was encountered while handling the remote login. Microsoft.AspNetCore.Authentication

EF Core with Cosmos DB provider, UserManager AddLoginAsync gives ConcurrencyFailure

亡梦爱人 提交于 2021-02-15 07:35:24
问题 Creating a new user, fetching the user again with usermanager for testing, and then using the method AddLoginAsync with the recently fetched user gives the error ConcurrencyFailure, Optimistic concurrency failure, object has been modified. When fetching the user the "ConcurrencyStamp" has the correct etag, but after the "AddLoginAsync" I can see the user object has an invalid etag, the ConcurrencyStamp is a GUID. I have followed the documentation and added this to the IdentityUser model

Blazor - Securing using ADFS with local DB repository: how/when to hook into SQL

痞子三分冷 提交于 2021-02-11 13:38:17
问题 I have a Blazer Server app which now uses authentication from a local ADFS server. Having identified the user, I now need to load their permissions. We don't think this can be provided via claims from the ADFS server, so want to configure this in the DB, but need to understand how/when to get this information. Regarding the hook into ADFS, my code is as follows (any suggestions on improvement most welcome) App.razor <CascadingAuthenticationState> <Router AppAssembly="@typeof(Program).Assembly

EF Core with Cosmos DB provider, UserManager AddLoginAsync gives ConcurrencyFailure

岁酱吖の 提交于 2021-02-11 12:49:46
问题 Creating a new user, fetching the user again with usermanager for testing, and then using the method AddLoginAsync with the recently fetched user gives the error ConcurrencyFailure, Optimistic concurrency failure, object has been modified. When fetching the user the "ConcurrencyStamp" has the correct etag, but after the "AddLoginAsync" I can see the user object has an invalid etag, the ConcurrencyStamp is a GUID. I have followed the documentation and added this to the IdentityUser model

Identity with ASP.Net Core 3.1 - on not authenticated, the app is not redirecting to Login in production like it does in dev

夙愿已清 提交于 2021-02-11 06:16:43
问题 I have an ASP.Net Core (3.1) web app that takes advantage of Identity. It works as desired on my dev box, but does not redirect to login in production. Let me explain. I have a home/landing page with links to actions all over it. If a user clicks on an action that requires Authentication (I am using the [Authorize] tag to specify that in my controller), then the app should redirect to the Login page to allow the user to login first and then redirect to the desired action that they click. This

Identity with ASP.Net Core 3.1 - on not authenticated, the app is not redirecting to Login in production like it does in dev

 ̄綄美尐妖づ 提交于 2021-02-11 06:16:24
问题 I have an ASP.Net Core (3.1) web app that takes advantage of Identity. It works as desired on my dev box, but does not redirect to login in production. Let me explain. I have a home/landing page with links to actions all over it. If a user clicks on an action that requires Authentication (I am using the [Authorize] tag to specify that in my controller), then the app should redirect to the Login page to allow the user to login first and then redirect to the desired action that they click. This

Identity with ASP.Net Core 3.1 - on not authenticated, the app is not redirecting to Login in production like it does in dev

假如想象 提交于 2021-02-11 06:16:03
问题 I have an ASP.Net Core (3.1) web app that takes advantage of Identity. It works as desired on my dev box, but does not redirect to login in production. Let me explain. I have a home/landing page with links to actions all over it. If a user clicks on an action that requires Authentication (I am using the [Authorize] tag to specify that in my controller), then the app should redirect to the Login page to allow the user to login first and then redirect to the desired action that they click. This

asp.net core 3.1 getting current identity user within stripe HttpPost(“webhook”) returns NULL

旧街凉风 提交于 2021-02-10 16:15:48
问题 I've integrated stripe checkout payments in my website according to stripe's example Everything works fine. I could verify webhooks are working with stripe CLI and also using ngrok, tunneling my localhost . Now I've started implementing interaction with the identity database. I wanto to store there the stripe session.CustomerId after the webhook has fired checkout.session.completed . For that I need to access my Identity database. My code is: [HttpPost("webhook")] public async Task