Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Customising the CMS /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Authenticator::set_default_authenticator problem

Go to End

4 Posts   3440 Views


Community Member, 23 Posts

5 March 2009 at 10:44am

hey all!

I have a little problem with authenticators. I'm trying to change default authenticator, plus remove all other (in my case it's just MemberAuthenticator). Code in my _config.php:

Authenticator::set_default_authenticator('ExtendedAuthenticator'); // seems not work at all

it works well, I'm going to /Security/login/ to test my authenticator and it seems something go wrong from this point:

[User Error] Passed invalid authentication method
POST /Security/LoginForm
Line 215 in C:\Server\httpd\web\sapphire\security\Security.php

206 		if(isset($this->requestParams['AuthenticationMethod'])) {
207 			$authenticator = trim($_REQUEST['AuthenticationMethod']);
209 			$authenticators = Authenticator::get_authenticators();
210 			if(in_array($authenticator, $authenticators)) {
211 				return call_user_func(array($authenticator, 'get_login_form'), $this);
212 			}
213 		}
215 		user_error('Passed invalid authentication method', E_USER_ERROR);
216 	}
219   /**
220 	 * Get the login forms for all available authentication methods
221 	 *


    * Passed invalid authentication method
      Line 215 of Security.php
    * Security->LoginForm(HTTPRequest)
      Line 162 of Controller.php
    * Controller->handleAction(HTTPRequest)
      Line 107 of RequestHandler.php
    * RequestHandler->handleRequest(HTTPRequest)
      Line 122 of Controller.php
    * Controller->handleRequest(HTTPRequest)
      Line 262 of Director.php
    * Director::handleRequest(HTTPRequest,Session)
      Line 106 of Director.php
    * Director::direct(/Security/LoginForm)
      Line 115 of main.php

Is there any way to change authentication class not getting this errors? My main task is to add new conditions to login, like is user activated or not check. I've already added necessary things to db, so this check is last one... Thanks!


Community Member, 23 Posts

9 March 2009 at 11:33pm



Community Member, 541 Posts

15 November 2013 at 4:02am

Wow, this is a 4 year old post I am bumping, I think that is a first!

I am having a similar problem, I have a custom authenticator, loaded exactly as @Entar describes.

I have a login widget that loads the new authenticator and I can login using that, but if I try to use the login form, it causes this error?

I get the impression I am missing a step?




Community Member, 541 Posts

15 November 2013 at 4:17am

Right, I found a solution for this, hopefully it will help anyone else with this issue.

My problem was that on my custom authentication form, I had set the param $authenticator_class wrong. The param needs to be set to:

class CustomLoginForm extends MemberLoginForm {
    protected $authenticator_class = "MyAuthenticationClass";


Hope that helps someone else who gets stuck on this.