This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.
Hi. trying to create a front-end login script. why hasn't laravels auth system been included? is there an alternative to log someone in the front end so they can see a page specifically for them?
I am using that plugin but I'm struggling to find any docs explaining a manual way of logging a user in with a custom login form, that creates a session. in laravel i would be able to do this easily with Auth::attempt($credentials) etc and start the session. how do I do this in October?
Hi, I don't really use october anymore but I would assume you would implement a plugin like the one these guys a discussing
http://laravel.io/forum/07-01-2014-laravel-and-ldap
If I'm not mistaken the version I used didn't have support for LDAP out of the box.
I'm assuming the original poster found it already, but for those still looking, there is an account component demo complete with front end pages & partials in the demo theme that comes with October.
Follow along with this video to make functional: https://vimeo.com/97088926
The updated documentation of the User
plugin clearly explains how to authenticate users:
// Authenticate user by credentials
$user = Auth::authenticate([
'login' => post('login'),
'password' => post('password')
]);
For the LDAP authentication with Front end, I think it's easier to implement than overriding the backend authentication.
I have created a PoC for LDAP authentication with OctoberCMS backend and share in this post [https://www.learn4.fun/octobercms-ldap-plugin/]. You can check it out for reference if you want to do the similar things with Front end authentication.
@Khoatrand your link is broken / not working for the FE authentication, can you please provide a working link for this PoC?
gabor19990 said:
@Khoatrand your link is broken / not working for the FE authentication, can you please provide a working link for this PoC?
Hi,
You can check my repository for the PoC: https://github.com/khoatran/october-ldap
Best regards,
I used the bypass method to authenticate ldap user. I created default frontend user. Note: My requirement is just to authenticate ldap user. Open \rainlab\user\components\Account.php. Replace $credentials with below code.
$ldaprdn = array_get($data, 'login');
$ldappass = array_get($data, 'password');
$ldapconn = ldap_connect("YOUR_LDAP_SERVER") or die("Could not connect to LDAP server.");
if ($ldapconn) {
$ldapbind = ldap_bind($ldapconn, $ldaprdn, $ldappass);
if ($ldapbind) {
$credentials = [
'login' =>'DEFAULT_FRONTEND_USER_LOGIN',
'password' => 'DEFAULT_FRONTEND_PASSWORD'
];
} else {
$credentials = [
'login' =>null,
'password' => null
];
}
}
Last updated
1-11 of 11