-
-
Notifications
You must be signed in to change notification settings - Fork 473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use let's encrypt certificates in Docker-setups #574
Comments
The toolkit is able to read certs and private keys from the certs folder, so you don't need to inject the content in the SAML settings, instead place the cert and private key in the certs folder and rename them as the toolkit expects. I guess you should be able to create some link between the /etc/ssl and your saml toolkit cert. Or maybe some script that detect changes on such folder and sync the certs one |
Thank you, that was my expectation too. But what exactly do "as the toolkit expects" mean? If you look at my example, that what my system looks like. What do i have to change to make it work? Edit: To ask more precise. Which Files are needed where and what should be the content.
So as you can see, the files are in the certs folder named by service, whereas i found out, that the value of the parameter x509cert needs to be changed to the first section of the file authentik.penta-home.site.crt to make signing work. So how to make php-saml read that value from that file instead of the parameter? |
From documentation:
But this certs folder is not You can configure your own path for the settings and the certs folder by defining the ONELOGIN_CUSTOMPATH env. The toolkit will try to read SP private key from sp.key and public cert from sp.crt, so you will need to rename the files you have. As it seems you are trying to setup SAML on a multi-instance environment where you gonna have several SPs, I propose you to create the following structure: php-saml And:
That said, another option is to not use those let's encrypt certificates, and simply use a self-signed cert with less rate of rotation. |
Thanks, so for testing i tried:
Now restartet kimai/fpm.
-> is it really name sp.crt or should "sp" be replaced by something else? |
Notice the error you are receiving now is not related to the SP, but related to the IdP:
Make sure you configure the IdP x59cert parameter in the settings. |
i see - a missunderstanding. The Value x509cert which i was talking about is always under section idp. I have never given values in sp- section to make it work. So i want to have empty value for ipd- parameter x509cert in config and have saml authenticate to authentik. Currently it stills does only work when i set idp x509cert to value of authentik crt, which make work because that key is often changing. Cloud it be archived be naming the file to idp.crt ? Edit: Or maybe could i use some other Value of the chain like let's encrypts CA to always trust the connection (as any browser would do)? |
Yes, idp.crt should work |
not yet:
i have the impression, that the env may not reach php, or the file is not searched for. Can i set some debug flag in settings to see what saml is doing? |
I am using a project using php-saml (https://www.kimai.org/) in docker which authenticates to authentik (https://goauthentik.io) via SAML.
All works fine, when i manually set x509cert to the value of our authentik certificate which is generated by lets encrpyt. If i omit the x509cert- Value, the request fails and won't authenticate. Also if i set the wrong value there.
As let's encrypt certificates are often changing, i need to manually convert the certificates value in some x509cert- string and replace the value every view weeks plus refreshing the application cache, which is annoying.
The certificate- folder of letsencrypt is containing the pem- files and crt and key- files like authentik.domain.tld.key
But when i set /etc/ssl/certs of kimai to those files, only an error is thrown from saml-php.
The folder /etc/ssl in kimai looks like
whereas cert.pem won't resolve to let's encrypts files, as ca-ertificates.crt is not existent.
Does anybody have a quick solution how to use the let's encrypted certificates that way, that i do not need the x509cert- Value in php-saml config?
The text was updated successfully, but these errors were encountered: