asp.net-identity

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

霸气de小男生 提交于 2021-02-10 16:13:19
问题 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

ASP.NET Core 3.1 / Identity session never expires. How can I get it to expire on sliding expiration?

一笑奈何 提交于 2021-02-10 12:57:41
问题 A security check of my website showed that sessions (i.e. login) never expire. I've tested myself and I find the same - I opened up the site on localhost this morning and I'm still signed in from yesterday. I always assumed it would expire after 20 minutes like it would in .NET Framework apps. I'm using the ASP.NET Core Identity scaffolding with minimal changes other than implementing two factor authentication. In my Startup.cs I have the following code to add session support: services

ASP.NET Core 3.1 / Identity session never expires. How can I get it to expire on sliding expiration?

落花浮王杯 提交于 2021-02-10 12:57:17
问题 A security check of my website showed that sessions (i.e. login) never expire. I've tested myself and I find the same - I opened up the site on localhost this morning and I'm still signed in from yesterday. I always assumed it would expire after 20 minutes like it would in .NET Framework apps. I'm using the ASP.NET Core Identity scaffolding with minimal changes other than implementing two factor authentication. In my Startup.cs I have the following code to add session support: services

ASP.NET Core 3.1 / Identity session never expires. How can I get it to expire on sliding expiration?

荒凉一梦 提交于 2021-02-10 12:57:15
问题 A security check of my website showed that sessions (i.e. login) never expire. I've tested myself and I find the same - I opened up the site on localhost this morning and I'm still signed in from yesterday. I always assumed it would expire after 20 minutes like it would in .NET Framework apps. I'm using the ASP.NET Core Identity scaffolding with minimal changes other than implementing two factor authentication. In my Startup.cs I have the following code to add session support: services

ASP Core. Best practices for multiple identities

人走茶凉 提交于 2021-02-08 04:32:53
问题 env: Asp Core, Entity-framework In my system I have two types [Table("User")] ApplicationUser : IdentityUser<Guid> [Table("Customer")] Customer : IdentityUser<Guid> Both entities( Customer and User ) have many different fields, what makes using only one table in a Database not correct. And both entities must have possibility to do sign in. As I found ASP Net can have only one identity setup. Question: What is the best way or best practices to make this stuff work? 回答1: I suggest you not try

Migrate existing Microsoft.AspNet.Identity DB (EF 6) to Microsoft.AspNetCore.Identity (EF Core)

丶灬走出姿态 提交于 2021-02-07 13:20:17
问题 I am working on an application (APS.net MVC) which uses Microsoft.AspNet.Identity . Now I want to revamp my application to APS.net Core which uses Microsoft.AspNetCore.Identity . But those two has some differences in each model. Is there any direct way to generate initial migration for Microsoft.AspNetCore.Identit y related changes in-order to connect existing DB with Asp.net Core identity? 回答1: I was able to migrate existing DBs using the following steps. Create a new ASP.net Core project

ASP.NET Identity without Entity Framework

浪子不回头ぞ 提交于 2021-02-07 12:14:39
问题 Is it possible to use the new ASP.NET Identity without using Entity Framework and instead use your own methods? I have an MVC project that uses plain ADO.NET for data access. I want to implement ASP.NET identity but I would like to continue to use ADO.NET and stored procedures. This is the way that I have chosen to go. 回答1: I had similar requirements to yourself and have implemented a pure SQL Server version of the ASP.NET Identity framework. I started out by creating a sample project (using

OWIN SignOut doesn't remove cookie

夙愿已清 提交于 2021-02-07 11:16:30
问题 I am using the OWIN middleware in an external Authentication Server that my applications authenticate to using OAuth Authorisation Code Grant flow. I can redirect to the Authentication Server, authenticate against an external provider (Google) and redirect back to my client application with a logged in user and Application Cookie set just fine, however when I try to sign out the cookie remains after I call the AuthenticationManager.SignOut method. My cookie options in Startup.Auth.cs are: var

A simple ASP .NET MVC API controller using roles

三世轮回 提交于 2021-02-07 11:14:44
问题 I wrote a web application using ASP .NET MVC and authorization system by default. I configured IdentityRole and input through external providers. Using the current database I have created my data context. Now I want to write a Xamarin.Android app and connect to my database, I want a simple API. But the feature that you want to access this API was only available to user with a certain role. The API is really very simple and therefore do not want to add to the draft WCF or WebAPI project. How

A simple ASP .NET MVC API controller using roles

老子叫甜甜 提交于 2021-02-07 11:13:59
问题 I wrote a web application using ASP .NET MVC and authorization system by default. I configured IdentityRole and input through external providers. Using the current database I have created my data context. Now I want to write a Xamarin.Android app and connect to my database, I want a simple API. But the feature that you want to access this API was only available to user with a certain role. The API is really very simple and therefore do not want to add to the draft WCF or WebAPI project. How