Skip to content
This repository was archived by the owner on May 30, 2025. It is now read-only.

Conversation

@C1-10P
Copy link
Contributor

@C1-10P C1-10P commented Jul 20, 2018

I've found that a cached Apache ticket can not be used immediately by the php-smbclient library. In my workaround, I use the krb5 php-lib to convert the ticket in the correct format. With this modification it is possible to authenticate cifs-shares with a kerberos sso-ticket. Apache only creates a ticket cache when you enable Kerberos delegation.

C1-10P added 2 commits July 20, 2018 15:09
enable reuse of apache ticket cache
sync garbage collection cycle of KerberosAuth and NativeState
@icewind1991
Copy link
Owner

icewind1991 commented Jul 20, 2018

Can you move the KerberosAuth changes to a separate ApacheKerberosAuth class and pass the saveTicketInMemory as constructor parameter.

Also with the changes moved to a separate class it can properly throw an error when the krb5 extension is missing or the ticket is missing/invalid instead of silently changing the behaviour

@icewind1991 icewind1991 force-pushed the master branch 3 times, most recently from c1a84fc to 0fc2a08 Compare August 28, 2018 14:35
@icewind1991
Copy link
Owner

I've been having issues properly testing this because no matter what I seem to do KrbSaveCredentials doesn't set the KRB5CCNAME, do you maybe have any ideas what I could be doing wrong

@C1-10P
Copy link
Contributor Author

C1-10P commented Sep 25, 2018

I had this kind of problem with php-fpm. The solution was to set
env["KRB5CCNAME"] = $KRB5CCNAME or clear_env = no in the fpm conf, because php-fpm clears all apache env-vars.

@C1-10P
Copy link
Contributor Author

C1-10P commented Oct 2, 2018

Here is a detailed description of a working setup: https://github.com/C1-10P/php_kerberos_cifs_poc

@C1-10P
Copy link
Contributor Author

C1-10P commented Oct 11, 2018

You must also configure Kerberos delegation. For the test I have activated "Trust this user for delegation to any service" https://blogs.msdn.microsoft.com/autz_auth_stuff/2011/05/03/kerberos-delegation/

@icewind1991
Copy link
Owner

If followed the steps from your writeup and I'm testing with curl with --delegation always

@icewind1991
Copy link
Owner

Finally got this running locally, seeing if I can get it running in CI before merging

@icewind1991
Copy link
Owner

Merged this manually to handle the rebase.

Thanks for the work!

@icewind1991 icewind1991 closed this Nov 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants