Skip to content
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

Custom routes arent fully working #54

Open
natenatters opened this issue Feb 7, 2023 · 2 comments
Open

Custom routes arent fully working #54

natenatters opened this issue Feb 7, 2023 · 2 comments

Comments

@natenatters
Copy link

natenatters commented Feb 7, 2023

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 (#49)!

Right now, its quite an opinionated package, but we could make it GREAT! Im excited to hear your reply!

@johnotaalo
Copy link

Were you able to solve this?

@natenatters
Copy link
Author

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants