dotnet / dotnet/aspnetcore

Kestrel windows authentication prompts for the credentials

Open
#46,905 14 comments 0 reactions 0 assignees View on GitHub
area-auth needs-further-triage
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 10h
Merged PRs (30d)
281

Description

### Is there an existing issue for this?

- [X] I have searched the existing issues

### Describe the bug

Repro:
Server is Windows 10 Enterprise 22H2 with .NET 6 (6.0.14)

Create simple WebApp with the Windows Authentication hosted on the Kestrel.
Setup same as in the https://github.com/dotnet/aspnetcore/issues/37556.
Setspn set, Kestrel Running on my domain user account on a server.

I VPN to the remote server.

**Remote server:**
Browser: Edge version 110.0.1587.57 64bit.
Internet options set to trust http://computername and http://computername.mydomain.com and "Automatic logon only in Intranet zone"
When browser is reopened:
- For addresses: 127.0.0.1 and 192.168.XX.YY then I need to provide the credentials
- By computer domain name or FQDN: http://computername and http://computername.mydomain.com **I do not** need to provide the credentials.
In the application welcome screen I see for all cases "NTLM" for {@Model.User.Identity?.AuthenticationType}

**Local machine (or similarly co-worker's machine):**
Browser: Edge version: 110.0.1587.56 64bit
Internet options set as in the server.
Domain account credentials added to the Windows Credentials Manager.
For all addresses:
- 192.168.XX.YY
- http://computername
- http://computername.mydomain.com
I am forced to provide the credentials each time I reopen the browser.
Welcome page shows "NTLM" in all the mentioned cases.

### Expected Behavior

Credentials prompt does not appear for trusted intranet sites.

### Steps To Reproduce

* Create the app from the template
* Execute setspn on domain account
* set internet options
* add credentials to the windows credentials mnanager
* run the app in Kestrel

### Exceptions (if any)

_No response_

### .NET Version

6.0.14

### Anything else?

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.