-
Notifications
You must be signed in to change notification settings - Fork 72
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
Invalid inbound message destination #58
Comments
Hi @guiyomh I have the same issue here. My app is behind a proxy. The proxy handles the certificate, so the route for login_check is not the right one. In short, the login_check route from the outside is https://publicdomain.com/saml/login_check. And once it passes the proxy, it becomes http://insidedomain.local/saml/login_check. I think the way should be to tell SpBundle to trust http://insidedomain.local/saml/login_check. Is your issue the same as mine? Did you find a solution? |
It means that in your own Provide your own metadata xml, sent AuthnRequest, and received Response, and we can compare the values and see what is wrong. |
Thanks @tmilos for the information. It helped me solve the issue. I implemented a custom service extending I replaced the $acsUrl __construct() parameter to an array. So when I declare the service, the corresponding argument will be an array containing the login_check url from behind the proxy (http and .local url in my case) and from the rest of the world, like this:
And I changed the
This worked for me, I hope this will help. |
Hi @ChMat I'm having the same trouble as you had, I'm wondering to know if you changed that function on SimpleEntityDescriptorBuilder file on the vendor directory? If not, how did you do? |
Hi @jhonnynho As I wrote, I created a class in my application that extends This class contains the It looks like this (you'll probably want to adapt the namespace): // Service/AppEntityDescriptor.php
<?php
namespace AppBundle\Service;
use LightSaml\Builder\EntityDescriptor\SimpleEntityDescriptorBuilder;
use LightSaml\Model\Metadata\AssertionConsumerService;
use LightSaml\Model\Metadata\KeyDescriptor;
use LightSaml\Model\Metadata\SpSsoDescriptor;
use LightSaml\SamlConstants;
use LightSaml\Credential\X509Certificate;
/**
* Class AppEntityDescriptor
*
* @package AppBundle\Service
*/
class AppEntityDescriptor extends SimpleEntityDescriptorBuilder
{
/** @var array|string */
protected $acsUrl;
/**
* @param string $entityId
* @param array|string $acsUrl
* @param string $ssoUrl
* @param string $ownCertificate
* @param string[] $acsBindings
* @param string[] $ssoBindings
* @param string[]|null $use
*/
public function __construct(
$entityId,
$acsUrl,
$ssoUrl,
$ownCertificate,
array $acsBindings = array(SamlConstants::BINDING_SAML2_HTTP_POST),
array $ssoBindings = array(SamlConstants::BINDING_SAML2_HTTP_POST, SamlConstants::BINDING_SAML2_HTTP_REDIRECT),
$use = array(KeyDescriptor::USE_ENCRYPTION, KeyDescriptor::USE_SIGNING)
) {
$certificate = $ownCertificate;
if (!$ownCertificate instanceof X509Certificate) {
$certificate = new X509Certificate();
$certificate->loadFromFile($ownCertificate);
}
parent::__construct($entityId, $acsUrl, $ssoUrl, $certificate, $acsBindings, $use);
}
/**
* @return SpSsoDescriptor|null
*/
protected function getSpSsoDescriptor()
{
if (null === $this->acsUrl) {
return null;
}
$spSso = new SpSsoDescriptor();
foreach ($this->acsBindings as $index => $binding) {
// On ajoute toutes les url autorisées pour le service
if (is_array($this->acsUrl)) {
foreach ($this->acsUrl as $acsUrl) {
$acs = new AssertionConsumerService();
$acs->setIndex($index)->setLocation($acsUrl)->setBinding($binding);
$spSso->addAssertionConsumerService($acs);
}
}
else
{
$acs = new AssertionConsumerService();
$acs->setIndex($index)->setLocation($this->acsUrl)->setBinding($binding);
$spSso->addAssertionConsumerService($acs);
}
}
$this->addKeyDescriptors($spSso);
return $spSso;
}
} And in my
Finally, I add the service to LightSaml configuration in light_saml_symfony_bridge:
own:
entity_id: "https://your.entity.id" # required
entity_descriptor_provider:
id: app_entity_descriptor I hope this helps. |
Thank you @ChMat , I'm going to test it, but I have a doubt, did you edit something else? I mean on the security.yaml or in the ligh_saml_symfony_bridge.yaml. I think this it won't run automatically. I don't now if you add something lie this on the security.yaml
|
light_saml_symfony_bridge:
own:
entity_id: https://your.entity.id # required
entity_descriptor_provider:
id: app_entity_descriptor As here |
Thanks for pointing that @jhonnynho ! Like @tmilos wrote right above, you have to configure it in your I have updated my comment above so the reply is complete and correct. |
Ey @ChMat and @tmilos I did this steps but now I'm having this
security.yaml
services.yaml
|
Hi @jhonnynho Usually, you get this kind of response either:
Note that the It may be the |
Hi @ChMat Services.yaml
.env
There are my params, and that error happens after doing the login on SimpleSamlPHP |
Check your Both should be identical. |
I have exactly the same entity_id on my config and on SimpleSaml |
Hi guys, |
Thanks @ChMat It works like a charm! |
hi guys, theres a way to do similar escenario but for de endpoint "default_target_path", actually is calling my unsecured endpoint but i need that be redirected to the secured endpoint. I already did the same for the login_check and is working succesfully but i need also for the default_target_path wheres my codebehind do some validations for login user. |
when i'm redirect to /saml/login_check
i have a error :
The text was updated successfully, but these errors were encountered: