IIS URL Rewrite to another site using a specific Windows identity - iis

Is it possible to use IIS' URL rewrite module in the following scenario:
Site A hosted on IIS with anonymous authentication and URL Rewrite module
Site B hosted on IIS with Windows authentication
When a client requests Site A, the request is forwarded to Site B using a specific Windows identity
I've tried to configure the pool associated to Site A so that it runs under the identity I want Site B to be accessed with but it does not work, i.e. the client's Windows identity is used instead.

URL Rewrite runs so early in the stack that it doesn't have access to authentication data.so the only way to resolve the issue You can use the custom HTTP module which sends the authenticated user custom header. You could add an HTTP module to your app, or use global.asax, or you can use www.isapirewrite.com which runs later in the stack and has a handle on the auth data.
https://learn.microsoft.com/en-us/archive/blogs/benjaminperkins/configure-application-request-routing-with-windows-authentication-kerberos
https://learn.microsoft.com/en-us/archive/blogs/asiatech/a-quick-solution-when-windows-authentication-is-required-on-backend-web-server-for-arr-scenario

Related

I want some users to continue using HTTP while others should use HTTPS

I have recently switched my website from HTTP to HTTPS. For some external users, they do not have enough permissions to access via HTTPS and they still need to access via HTTP.
I want to keep both HTTP and HTTPS, but HTTP only for a specific group of users.
How to make this change in IIS 8?
Any ideas, please suggest.
You can try the following steps:
Step1: configure https.
Set IIS to work with HTTPS (http://learn.iis.net/page.aspx/144/how-to-set-up-ssl-on-iis-7/ )
Test HTTPS locally to make sure that it works.
In your firewall (to Internet), configure it so that it allows port 443 (https) to your IIS server.
This will allow ALL people to access your website using https, since we have not configured any restrictions.
Steps2: configure http.
Install WindowsAuthenticationModule if it is not already installed
In IIS Manager, click the website.
Double click Authentication in the middle pane
Select Windows Authentication and enable it
Select Anonymous Authentication and disable it.
Since the users on your local network is authenticated to AD, and the website is in their local zone, they should automatically authenticate and should not see the login box. People outside your network are not authenticated, hence should need to logon to access the website.

SSL Certificate Not Working for my Azure App Service

I choose to host my website in Azure.So I've created a App Service.Then Created a new domain for my App then created/bind the SSL certificate to my corresponding website.
After done with the SSL certificate .I'm still seeing my website url as http//: and not https://
Also i'm not seeing the Green URL for my Website ..!
It look like this
(P.s : My App Service Tier is AzureFreeTier (Basic: 1 Small)
My SSL Type is SNL SSL)
Please help to resolve my problem here
Thanks in Advance,
Jayendran
You need to do a redirect from HTTP to HTTPS. Installing a certificate just makes using HTTPS with your custom domain name possible.
You can either:
Configure your app to redirect to HTTPS when it receives a request over HTTP + enable HTTP Strict Transport Security
Or use an extension in Web Apps to do the first thing:
To install the extension, open your web app blade in Azure Portal. Go to Extensions, then click Add. Then you should find Redirect HTTP to HTTPS from the list and install it.
That will redirect any HTTP calls to HTTPS for you. I would still recommend adding Strict-Transport-Security headers to your responses to make sure your clients do not access your site insecurely the next time.
The reason you arrive to your site on HTTPS after AAD login is because the HTTPS version of your app's URL has been configured in AAD as the reply URL.
And this:
Your Connection to this site is not fully secure Attackers might be able to see the images
is a mixed content warning. It means you are loading content (e.g. images) using an HTTP URL in your pages. Change them to HTTPS and you will solve that problem.

URL Rewrite, ARR and SSO AzureAD with OWIN OpenIdConnect using wrong URL

I am currently using the IIS URL Rewrite Module and Application Request Routing on a server in the DMZ to forward requests to a web application running on an internal server.
The application which is deployed on the internal server has SSO which includes Azure AD using OWIN pipeline and openIdConnect.
When a user selects the authenticate using AzureAD option instead of being redirected to the https://login.microsoftonline.com/<tenantname>/...
they are redirect to http://my.company.com/<tenantname>/... where http://my.company.com is the URL used to access the application from the DMZ.
The SSO works for all internal instances i.e. where request are not being forwarded in a reverse proxy scenario.
Why is this happening when using URL Rewrite and ARR?
Unchecking the Reverse rewrite host in response headers checkbox under Application Request Routing Cache > Server Proxy Settings solved this issue.
Reverse rewrite host in response headers (checked)
ARR will rewrite the host name in the location header of a 301
response to the original host.
URL Rewrite keeps original host Location
IIS Url Rewrite ARR issue

ColdFusion 9 and IIS server encryption

We have a ColdFusion developer who claims that solely by adding a few lines of code in the Application.cfm file of an application that he wants to be encrypted that he can force the IIS Web server to encrypt all communications involving that application. So for example, let's assume this developer's ColdFusion application resides at www.ThisIsIt.com/xyz/. He includes a conditional statement in his Application.cfm file (see below) to force a Web browser to preface the URL to his application with https.
<CFIF not cgi.server_port_secure>
<CFLOCATION URL="https://#cgi.server_name##cgi.script_name#" ADDTOKEN="no"/>
</CFIF>
Meanwhile within Internet Information Services (IIS) Manager, the xyz directory is NOT set to require SSL. If you visit https://www.ThisIsIt.com/xyz/, it will in fact be prefaced by https, but how can the content of his application as well as the communication between server and client Web browser be encrypted if the IIS Web server is not instructed/configured to encrypt the xyz directory, and why does the Web browser indicate an encrypted communication? Is this a mere trick or a legitimate means to encrypt a ColdFusion application?
The application-based rule works by detecting that SSL is not being used and redirects the user to the secure HTTPS domain. A valid SSL certificate is required to be configured otherwise a security message is displayed.
This method only forces HTTPS access for ColdFusion scripts. Static, non-CFML files like CSS, JS, PDF (that don't care about the presence of the application.cfm script) can be accessed directly without any HTTPS redirect.
The best way to "force" SSL for all web requests using IIS is with a web.config rule.
https://stackoverflow.com/a/29089228/693068

IIS6 - HTTP redirect to HTTPS - how to disable authentication on the http

Currently I have two sites setup in IIS.
Primary Site (Uses HTTPs and requires windows integrated authentication)
Secondary Site (Uses HTTP and redirects to the HTTPs)
My problem is that if I set anonymous authentication on the HTTP redirect site, it just passes through to the HTTPS without requiring authentication.
If I have windows integrated authentication setup on the redirect site, users are forced to authenticate on the HTTP site which voids the whole reason I want to use https (to encrypt authentication).
Any help is greatly appreciated!
You may have your HTTPS site mis-configured. Check to make sure that anonymous authentication is disabled on the HTTPS site (only Windows Integrated authentication checked). If both are checked, it will allow the anonymous request through without challenging the user for credentials.

Resources