You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Testing the LDAP connection is successfull php artisan ldap:test
The models for each connection:
<?php
namespace App\Ldap\Alpha;
use LdapRecord\Models\Model;
class User extends Model
{
public static array $objectClasses = [];
protected ?string $connection = 'alpha';
}
<?php
namespace App\Ldap\Beta;
use LdapRecord\Models\Model;
class User extends Model
{
public static array $objectClasses = [];
protected ?string $connection = 'beta';
}
In api.php instead of the middleware auth:sanctum i changed to auth:alpha,beta
This discussion was converted from issue #770 on July 30, 2025 13:00.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I am using laravel 12 with SPA Sanctum Authentication and LdapRecord.
Until now I had only one domain
alpha, and now I want to configure the app to use multiple domains.The confusion for me is in the guards
auth.php, because sanctum is using the web quard by default, so I ma not sure if I configured properly.According to the documentation https://ldaprecord.com/docs/laravel/v3/auth/multi-domain you have to use two guards and two models.
I have remove the web guard and add those two new guards
auth.phpand the two providers:
I have created those two connections
ldap.phpTesting the LDAP connection is successfull
php artisan ldap:testThe models for each connection:
In api.php instead of the middleware
auth:sanctumi changed toauth:alpha,betaIs working, at least that's what it seems like, ... but how sanctum is working properly if the guard web is no more there?
That's the confusion for me.... Is my configuration ok in order to work with sanctum with multiple domains?
Beta Was this translation helpful? Give feedback.
All reactions