laravel-saml2
laravel-saml2 copied to clipboard
Custom routes arent fully working
This is more of a discussion than a bug report.
I am using sub-domains to identify my tenants, not a uuid in the path.
So, one tenant might access my app via:
tenant1.myapplication.com
To achieve this, I have set saml2.useRoutes to false, and removed the default UUID from the route.
Then, I had to replace the ResolveTenant middleware, to find a tenant first from my own tenants table, then get the saml2_tenants via a relationship.
I also had to extend part of OneLoginBuilder, the configDefaultValues method, to use the correct routes, instead of this URL::route('saml.metadata', ['uuid' => $this->tenant->uuid]).
This is needed because the current method would generate:
tenant1.myapplication.com/saml2/metadata?uuid=123e4567-e89b-12d3-a456-426614174000
The IdP doesnt like. It would be better as:
tenant1.myapplication.com/saml2/metadata
This isnt much work, but feels like I am going against the package.
Would you be open to a discussion/ a PR around having a new way to resolve tenants based on a saml_tenants.sub_domain value.
Or, ideally, would be to use it from a custom tenant model (https://github.com/24Slides/laravel-saml2/pull/49)!
Right now, its quite an opinionated package, but we could make it GREAT! Im excited to hear your reply!
Were you able to solve this?
Yeah it all works now, using the approach above. Still feels a bit hacky to implement my own code on this package, but it doesnt seem too active at the moment...