It sounds like configuring the KDC entries would be reasonable. There's
not really a "default realm" setting in the registry, though.
This is one of the bugs I fixed on master -- the routine to get the
principal name from the cache attempts to get the full TGT, which is
(frequently, in most configurations) denied by security policy. My new
code will just request a list of the tickets present (and not the secret
keys), which should always succeed and be able to determine the principal
name.
There are some related codepaths that fail if there is only a TGT in the
cache, but would succeed if there was a service ticket present (since the
session key can be retrieved for a service ticket), but I don't think this
is actually relevant in this particular case.
> # now I try to copy the TGT in the MSLSA cache
> C:\Programme\MIT\Kerberos\bin>mit2ms.exe
> mit2ms.exe: Ccache function not supported: read-only ccache type while
> copying default MIT ccache to MSLSA ccache
>
> # MSLSA ccache is readonly?
> # this procedure works for me on Windows 7
This is going through a different (open-coded) version of the
principal-detection logic, so it is unsurprising that it fails.
The KRB5_CC_READONLY error is only generated in a small number of places,
though it's not 100% clear which one would be at fault. krb5_lcc_store()
would make the most sense, since we first try the KerbSubmitTicketMessage,
which is not supported on XP and Server 2003. Since that works on all
newer systems, the fallback codepath is poorly tested. The fallback goes
through the KerbRetrieveEncodedTicketMessage, which IIRC will fail if the
target realm is a non-AD realm and there are no registry settings for the
KdcNames.
> Now I try the get the TGT direct in the MSLSA ccache:
> =========================================================
> # destroy Initial default ccache
> C:\Programme\MIT\Kerberos\bin>kdestroy
>
> # get TGT for MSLSA ccache (works on Windows 7), no error shown
> C:\Programme\MIT\Kerberos\bin>kinit -c MSLSA:
MST...@CORP.ORG
> Password for
MST...@CORP.ORG:
>
> # show the TGT, nothing shown ...
> C:\Programme\MIT\Kerberos\bin>klist -c MSLSA:
> klist: Matching credential not found while retrieving principal name
>
> # try default ccache, same result, nothing shown ...
> C:\Programme\MIT\Kerberos\bin>klist -c API:
> klist: No credentials cache found (ticket cache API:Initial default ccache)
> =========================================================
The TGT was obtained and inserted into the MSLSA cache, but is not being
displayed because of the interaction between the windows security measures
and the KfW code. For security, the session key in the TGT is zeroed out
in the returned data structure, but the (old) KfW code treats the
all-zeros session key as meaning that the ticket should be ignored, and
displays nothing. If there was a service ticket in the cache, the KfW
code would retrieve that successfully, and infer that a TGT existed for
purposes of display (blech).
> Is there a possibility to debug this, or do you have a hint?
Well, I do not think there is much point in trying to debug the lack of
klist output. It might be worth debugging the mit2ms.exe failure, but it
is hard to conjure up energy to care about Server 2003, if things work on
the newer systems.
> Before I can test SAP with SNC_LIB=gssapi32.dll I should have a TGT in
> the MSLSA ccache?!
When using the KfW 4.0.x gssapi32.dll, there should not be a need to
already have a TGT -- I believe the library can launch MIT Kerberos.exe
and pop up a "Get Ticket" window. However, having a TGT present will
eliminate the need for that popup, and is the mode I normally operate in.
> > I do note that Windows Server 2003 goes out of support in just a few
> > months, so hopefully those machines will not be in service for much longer
> > anyway.
>
> Oh Yes, I know, but like mentioned, we do not administrate this
> Servers, we only provide the
> SAP services and can provide suggestions (for the other department)
> howto do the SSO to our services...
I would recommend making the API: cache the default and having SAP use
that, if there is no external need for using the LSA cache. Getting
things working properly with the LSA cache can be very frustrating, and
the API: cache should be much simpler to set up.
-Ben