OpenConext / Mujina

A mock IDP and SP using the OpenSAML library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot run Mujina-idp at machine which doesn't start tests

max-9o opened this issue · comments

Hello! I do some SAML test automation using Mujina as idp and company's software that I worked for as SP. This SP already has working SAML integration.
I just set Mujina's metadata.xml at my SP and everything worked perfect with Mujina hosted at localhost and tests run at the same localhost.

Now I tried to move Mujina to another VM and continue to run tests at localhost but stuck with error after redirection from SP to IDP:
{"timestamp":1520518952638,"status":500,"error":"Internal Server Error","exception":"org.opensaml.xml.security.SecurityException","message":"SAML message intended destination endpoint did not match recipient endpoint","path":"/SingleSignOnService"}

I tried to replace http://localhost:constants at MetadataController and MetadataControllerTest with actual network name of Mujina host VM but it didn't work out.
Should I replace all of localhost entries( or better move it to smthg like .properties file at Pull Request) to make Mujina work in such situation?
Or it's not the right way at all?

If you add the following line <logger name="org.opensaml" level="DEBUG"/> to https://github.com/OpenConext/Mujina/blob/master/mujina-sp/src/main/resources/logback.xml and run both IdP and SP and do a SAML login on localhost:9090 you will see the debug log Checking SAML message intended destination endpoint against receiver endpoint. You can see the details and in combination with this stack question & answer you will probably will be able to solve your issue.

Thanks for your advice. Anyway I did it by using of base_url and port from yaml config value from Mujina/mujina-idp/src/main/resources/application.yml instead of hardcoded values. I'll try to make pull request later.