Open MichMich opened 3 days ago
This seems really sucks but worked 🤔
$ php artisan db
mysql> update saml2_tenants set uuid='okta' where id=1;
Then all urls are now under /saml2/okta/[...]
Yeah that probably works but seems like a dirty hack. Thanks for the suggestion though.
Currently, tenants (SAML providers) are registered via Artisan commands and can be accessed through URLs like:
/saml2/b2dae2e6-e814-4553-a3a5-a56ddaca1110/login
While this works, I would prefer to use a more friendly identifier (such as a key) in the URLs, like:
/saml2/okta/login
To achieve this, I created a custom middleware that attempts to resolve the tenant by the friendly key and then falls back to the default UUID-based behavior if the key is not found. Here’s the code I used:
I also overrode the
saml2.resolveTenant
middleware in bootstrap/app.php like so:Question:
Is there a cleaner or more integrated way to accomplish this, or perhaps a feature that could be added to the package to support friendly keys natively?
Thanks for your work on this package, and I appreciate any insights you might have!