Jump to:

5099 Posts in 1519 Topics by 1116 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Authenticator::set_default_authenticator problem

Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1138 Views
  • Entar
    Avatar
    Community Member
    18 Posts

    Authenticator::set_default_authenticator problem Link to this post

    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::register_authenticator('ExtendedAuthenticator');
    Authenticator::set_default_authenticator('ExtendedAuthenticator'); // seems not work at all
    Authenticator::unregister_authenticator('MemberAuthenticator');

    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
    Source

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

    Trace

    * 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!

  • Entar
    Avatar
    Community Member
    18 Posts
    1138 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.