Run as a Windows account in IIS? - asp.net-core

I need to move a Asp.Net Core Kestrel application to IIS. The Asp.Net core application uses many Integrated Security connection strings and also need to access many other resources. The account used to run the application has all the permissions.
Now I will need to host it in IIS. Is it a way to "run as" the Asp.Net core code as a different account instead of the system account "Domain\MachineName$"?

Related

What's the equivalent of htpasswd in ASP.NET Core

I am working on an ASP.NET Core web application.
Please note I am not working with IIS.
The maintenance team, in charge of the server administration does not have access to the application source code.
Is it possible for the maintenance team to add a user/password restriction to access the application ?
It is possible with a php application running on apache server with .htaccess/.htpasswd mechanism. This mechanism is independent of the application.
Is it possible to do the same with a .NET Core Kestrel web server ?
Thanks

ASP.NET Core MVC - Windows Authentication

I have a general question about using Windows authentication in an ASP.NET Core MVC project.
As far as I could understand is that you can have the authentication based on the Windows user. If I would deploy the website and different clients would connect to the website, would I be able to get all the windows user names that are connecting to the page? And also would they also see different content if I would program the content based on the Windows user that is connecting?
Thanks

Can I run .Net 4.6 Application under .Net Core Site on IIS

I inherited a project that is a collection of WCF Services that target .Net Framework 4.6.1. I wrote a front end SPA application that targets .Net Core 2.2 not realizing that the hosting model was such that both the UI (.Net Core) and the API (.Net 4.6.1) need to run under one Site on IIS.
I'm trying to get this to work on my local machine. I created a new Site in IIS -- Site A. I published my .Net Core application to Site A and set it up with an application pool set to "No Manged Code".
I then added an Application to Site A called API and added all my WCF services in that folder. I configured API to use an application pool that targets ".NET CLR 4.0".
I updated the web.config in the root of Site A to include all the necessary bits for WCF.
I'm able to hit Site A and get my SPA UI, but when I do anything that attempts to hit the backend API (including trying to hit it directly -- http://localhost:464646/api/test.svc), I get the following error:
HTTP Error 502.5 - ANCM Out-Of-Process Startup Failure
Is what I'm doing even possible? If so, what changes do I need to make in order to get this to work?

How to configure .NET Core Identity to work with Kubernetes

I have a .NET Core MVC web application that is containerized and running in Azure Kubernetes Service. The application uses .NET Core Identities for user authentication.
The problem I have is that when I scale up the application to multiple instances, user authentication becomes unreliable. I believe this is because the load balancer does not guarantee that subsequent requests from the same user session go to the same instance, and as the authentication cookies creating on one instance are not valid on another instance, the user is directed to the login page again.
With the .NET Framework I would set the machineKey in the webconfig, and so multiple instances would be using the same key for encryption.
What is the appropriate way to manage this situation with a .NET Core application?

Can I host a wcf 4.0 website in IIS instead of as an application in IIS?

Most examples I see about hosting WCF in IIS have you create an Application under an existing website. I have a website in IIS, but the website uses a .NET 2.0 app pool, so I can't host the service as an application under the website. Is it better to create an empty website to just host the service or to create an empty website and then create an application under that empty website to host the service?
I have WCF running as a WebSite in both IIS6 and IIS7, and they work fine. They basically work exactly the same as any ASP.NET site; the .svc files are conceptually similar to .aspx pages, in that IIS calls over to .NET to process them, and all the core WCF stuff is in the assemblies in \bin. The web site is assigned to an App Pool where the actual processes run, just like a normal ASP.NET site. I don't think you need to make an 'Application' in IIS.
You don't need a new website - you can still host WCF in a 2.0 application pool - but in your project you'll need to set the target framework version to 3.5, instead of 4.0.