Skip to content

Database Sync Auth on certain email domains #253

Answered by stevebauman
jmurphy45 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @jmurphy45,

You will have to configure two authentication guards (inside of your config/auth.php file -- one for LDAP auth and one for Eloquent auth), and then swap them depending on the user submitted email using Auth::shouldUse($guard).

The built-in LdapRecord-Laravel auth database driver only supports fallback when a user cannot be found in the directory, and does not allow for custom conditions.

https://ldaprecord.com/docs/laravel/v2/auth/database/laravel-breeze/#fallback-authentication

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by stevebauman
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants