Sounds a bit like you should use Socialite https://laravel.com/docs/11.x/socialite
Dec 23, 2024
4
Level 1
Software design for dynamic identity provider
I have a multi-tenancy application where I will be having atleast 3 tables
- organizations
- id
- domain
- owner_id (
fkto users)
- users
- id
- organization_id (
fkto organizations)
- identity_providers
- config (arrayable field)
- organization_id (
fkto organizations) - type (
openidorsaml2)
I want to allow organization owners to configure saml2 identity provider and on the login page I want to check domain from email, get organization, get identity provider, configure socialite with identity_providers.type and redirect it.
Please not there is only one authentication endpoint where I want to support multiple organization idp.
Of course if the idp is not configured, it will ask for the password in the step 2.
I want to ask, if I set config dynamically in a middleware, will it work for concurrent requests?
// Get organization and idp details here
config(['services.saml2' => [
// Add saml2 configuration here
]]);
Level 73
Please or to participate in this conversation.