Skip to content

NegotiateAuthentication failed authentication doesn't notify of TargetUnknown #126337

Closed

Description

@mconnew

Description

When attempting to initialize the security context, on Windows, if the native error code returned is SecurityStatusPalErrorCode.TargetUnknown, this is currently mapped to NegotiateAuthenticationStatusCode.GenericFailure. On unix, the equivalent error(s) would be the major error code is GSS_S_FAILURE, the minor error code is KRB5KDC_ERR_S_PRINCIPAL_UNKNOWN. This also gets mapped to GenericFailure.

Reproduction Steps

No minimal repro possible as requires server/client infrastructure in a domain

Expected behavior

If a non-existent SPN is specified as the target, the NegotiateAuthenticationStatusCode statusCode should be TargetUnknown (value 14).

Actual behavior

You will get NegotiateAuthenticationStatusCode.GenericFailure returned

Regression?

No, just an omission in the original implementation.

Known Workarounds

No response

Configuration

No response

Other information

No response

Activity

  1. added
    untriaged
    on Mar 30, 2026
  2. dotnet-policy-service commented on Mar 30, 2026

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @dotnet/ncl, @bartonjs, @vcsjones
    See info in area-owners.md if you want to be subscribed.

  3. removed
    untriaged
    on Apr 8, 2026
  4. added this to the 11.0.0 milestone on Apr 8, 2026
  5. locked and limited conversation to collaborators on Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions