Flow Routes Domain/Subdomain

Hello,

I’ve a Flow (3.0.1) installation with some packages. Each (StandardController) of this package should be called, if a defined subdomain is used.

For example:
Domain: abc.domain.tld should route to My.Foo => StandardController
Domain: xyz.domain.tld should route to My.Bar => StandardController

How I have to define my Routes.yaml to get this working? Is there a special “RouteDomainHandler” or something?

Thanks for every help!

Hi Sascha,

unfortunately domains/subdomains are not yet supported by the Flow Routing Framework.
This feature request comes up from time to time and we should probably implement it at some point.

There’s an old forge ticket that already contains some ideas on how this could be solved, see: https://forge.typo3.org/issues/53080
If you feel like you could port this ticket to our current bug tracker at jira.neos.io.

In the meantime: You can use a custom Route Part Handler to check for the (sub)domain but RoutePartHandlers will only be evaluated upon first hit(!) unless you disable the routing cache which is a bad idea mostly.

Another option could be a custom HTTP Component that detects the domain and sets some additional routing values either before or after the regular “routing” component. Let me know if you need further details on how to achieve this.

Best,
Bastian

Hi,

I didn’t get it working with a custom Route Part Handler or a custom HTTP Component… It would be nice to have an example about how to do this with a custom HTTP Component.

In the meanwhile I’ve solved my problem with a custom Sub/Context and seperate Routes.yaml for every subcontext. Surely not the best practise way to do it, but for now it’s ok.

My next problem is authentication, because of the different subdomains. I’ve found the Flowpack SSO Server/Client Package (https://github.com/Flowpack/Flowpack.SingleSignOn.Server)

Is this package working (last commit was in 2013 for Flow 2.0) for the new Flow 3.0.x ?

Edit:
Is it possible, to have one single Flow Installation with a SSO.Server and SSO.Client but with multiple subdomains? So that users only must authenticate on one subdomain?

Thanks!
Sascha

Is this package working (last commit was in 2013 for Flow 2.0) for the new Flow 3.0.x ?

I just recently tried that myself locally because we might use that packages ourself for a project. There are some small adjustments to make (policy configuration mainly), but it works. I might be able to prepare a PR for 3.0 compatibility over the weekend, but can’t promise it.

Is it possible, to have one single Flow Installation with a SSO.Server and SSO.Client but with multiple subdomains? So that users only must authenticate on one subdomain?

That’s exactly what SSO (Single Sign On) solves: you have a single server instance running on one domain (say auth.mydomain.com). Then for every other project, that want’s to use authentication, it makes use of SSO.Client package and configures it to authenticate against “auth.mydomain.com”. That way, you even stay logged in when switching from a.mydomain.com to b.mydomain.com and even to myotherdomain.org as long as they all are SSO.Clients that authenticate against auth.mydomain.com.
And yes, in theory they can even share the same flow installation, though that would require different sub-contexts for server and clients, as they need different authentication entry point configs.

Thanks for your answer.

I’ll try to setup / integrate this sso package, but at the moment without any luck. Maybee I’ll ask again when I figured out why it doesn’t work

Edit

After two hours of try and error…

  • The Vagrant Demo won’t install correctly (FATAL: Chef::Exceptions::ChildConvergeError)
  • Trying to setup the sso server/client into my Flow installation without success

Maybee the fact, that I only have one Flow Installation with multiple subcontext and subdomains, which is client and server at the same time is my problem