Hey,
the same here. I think this should be the same topic so I put my question right here :)
I'm new to simplesamlphp ant want to develop a single-sign on like that:
- one idp (domain1)
- one sp (domain 2)
- app1 (domain3) and so on.
The SP is some kind of front-end or "translator" for the applications to be able to talk SAML to the IdP. Therefore, the SP and the application itself must both be under the same domain. You could have a SP in a different domain than the apps, but in that case it will act as some kind of proxy, and you'll need a way to communicate and exchange authentication data between it and the apps themselves, which is kind of non-sense since you are making it much more complicated than it needs to be.
The SP is able to communicate with the idp fine (by using the simplesaml install page).
But the application does not.My first problem was, that the idp does not know the application, so i added the app to saml20-sp-remote.php, which looks a bit strangebecause the app has nothing to do with simplesaml (except of 3 Lines to authorize) and the url looks like a simplesaml one.
That's because the app should not talk to the IdP directly, but should delegate that to the SP. Your apps should make use of the SSP API to trigger authentication if needed, and/or gather authentication status and attributes from the user. You don't need to add any information about the application itself in the IdP.
After that I can authorizise with success but instead of redirect I get a no_state error.
What I guess is happening here, according to the scenario you depicted before, is that you are loosing your state information because you are redirecting to a different domain than the one that initiated the login. If you have SP in one domain and apps in different domains, but same server after all, you might be triggering authentication from the domain of the SP, but redirecting back to the apps as you configured it that way in the IdP. That's entirely wrong, because different domains mean different cookies and therefore different sessions.
Somy question: Can I do something? Maybe the mistake is in the way I trie to inform the idp about the applications or do I need one SP for every app?
Exactly. If your apps are in different domains, then you need a different SP for each of them (which does not necessarily mean different simpleSAML instances). Both the app and the SP should be under the same domain, but if all your apps are in the same server with different virtual hosts, you can easily configure simpleSAML to act as SP for all of them. You just have to fetch the current virtual server options (domain, port, base path and so on) at the beginning of the config.php file, and build the 'baseurlpath' property according to these options.
Regards,