Skip to content

Kerberos ticket is not fetched when target is a user #16576

Closed

Description

@vijaykota

The xplat NegotiateStream implementation is able to successfully use Kerberos auth when the target of AuthenticateAsClientAsync is a service principal eg. HOST/machine, HTTP@machine etc. However, if the target is a user like foo@domainfqdn, the auth is failing. Perhaps in this case, the gss_import_name needs to be called with some OID other than GSS_KRB5_NT_PRINCIPAL_NAME

Activity

  1. iamjasonp commented on Mar 3, 2016

    @iamjasonp
    Member

    Awesome, thanks @vijaykota.

    Should we also be considering whether or not to translate the domain part of the UPN into uppercase as well? In our testing, we have found that the UPN must be in uppercase for the scenario to work.

    Not sure if that would be a safe operation though.

  2. vijaykota commented on Mar 3, 2016

    @vijaykota
    ContributorAuthor

    Translation of domain would not be safe since the Linux default is to be case-sensitive.

    This seems like a complex issue to solve on Linux:

    kinit -S $user $user
    foo@DOMAIN.CORP.MICROSOFT.COM's Password:
    kinit: krb5_get_init_creds: Server (foo@DOMAIN.CORP.MICROSOFT.COM) unknown
    
    

    On a Windows server I see failure like:

    e:\>klist get %user%
    Current LogonId is 0:0x28e0ff
    Error calling API LsaCallAuthenticationPackage (GetTicket substatus): 0x52e
    
    klist failed with 0xc0000408/-1073740792: Kerberos sub-protocol User2User is required.
    

    But Windows NegotiateStream is able to successfully get a ticket.

  3. vijaykota commented on Mar 3, 2016

    @vijaykota
    ContributorAuthor

    Looks like this requires User2User protocol support. We need to figure out if the MIT Kerberos implementation has this support

  4. karelz commented on Feb 2, 2017

    @karelz
    Member

    The scenario seems to be rather corner-case.
    @zhenlan @mconnew is it something you guys use in WCF?

  5. davidsh commented on Mar 15, 2019

    @davidsh
    Contributor

    User2User protocol support is unlikely to be needed in cloud scenarios.

    User-to-user authentication is a special Kerberos application protocol, that allows users to host secure application services on their desktop machines. It is increasingly common for users to offer desktop services that merit secure authentication, such as nfs and ftp. When users configure their desktop servers with a long-lived srvtab key, this long-lived key becomes a very attractive target for theft. User-to-user authentication enables a user to run a server without keeping a long-lived key on disk. Instead, the user's short-lived TGS session-key takes the place of the usual srvtab secret key, in the server's authentication handshakes.

    Closing this for now until we get more customer feedback.

  6. mconnew commented on Mar 18, 2019

    @mconnew
    Member

    I just saw this issue. This is a scenario that WCF uses quite extensively and is NOT a corner case for us. If you run a server as non-system (ie self-hosted), then you must use a non-default service identity. As configurating a custom SPN requires additional domain permissions and isn't very friendly for quickly setting something up, most users will use a UPN instead.
    Edit:
    This issue is also related to issue dotnet/corefx#27745. Once WCF is able to set a custom SPN, we will be able to be a client to console hosted WCF servers using Windows auth. This is a broken scenario for us right now and have been waiting several years for this support. Once issue dotnet/corefx#27745 has be completed, this issue will affect HTTP Negotiate authentication too.

  7. davidsh commented on Mar 18, 2019

    @davidsh
    Contributor

    This is a scenario that WCF uses quite extensively and is NOT a corner case for us. If you run a server as non-system (ie self-hosted), then you must use a non-default service identity. As configurating a custom SPN requires additional domain permissions and isn't very friendly for quickly setting something up, most users will use a UPN instead.

    .NET Core doesn't support NegotiateStream as a server on Linux. So, are you referring to a scenario where NegotiateStream (acting as a server) is being used on a Windows machine? And your requirement is that Linux clients be able to connect to it?

  8. mconnew commented on Mar 18, 2019

    @mconnew
    Member

    @davidsh, that is exactly the case. Linux client connecting to a Windows WCF service.

  9. self-assigned this
    on Mar 18, 2019
  10. 6 remaining items

  11. mconnew commented on Nov 16, 2023

    @mconnew
    Member

    @wfurt, yes it is still important. I should be able to create a solution using CoreWCF and WCF Client relatively easily, along with a WCF equivalent on .NET Framework. Super backed up with tasks right now though. Ping me a couple of weeks before you want to start work on this and I will put something together for you.

  12. ghost closed this as completedon Dec 15, 2023
  13. reopened this on Dec 18, 2023
  14. ghost closed this as completedon Jan 16, 2024
  15. locked and limited conversation to collaborators on Feb 15, 2024
  16. modified the milestones: Future, 9.0.0 on May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions