Jump to:

5541 Posts in 1738 Topics by 1224 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Extend Authentication Rules

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

Page: 1
Go to End
Author Topic: 1317 Views
  • aandrade
    Avatar
    Community Member
    2 Posts

    Extend Authentication Rules Link to this post

    Hi all, I need to extend the authentication rules used by default in the CMS, so not just a user/password and status checking. I need to add some rules based on some other cirteria on things like account expiration date, etc...

    Any ideas on what files need to be modified or created will help a lot.

    Thanks

  • banal
    Avatar
    Community Member
    901 Posts

    Re: Extend Authentication Rules Link to this post

    Hi

    Should be possible, although I never did this.
    Have a look at the sapphire/security folder. There you'll find the MemberLoginForm and MemberAuthenticator which are the classes used to login a member.
    The Security class is the Controller that's being called when you visit yoursite.com/Security/login. It gets the registered authenticators and displays their login form(s).

    You can create your own LoginForm/Authenticator (or inherit from MemberLoginForm/MemberAuthenticator) and register it as default authenticator (see Authenticator::set_default_authenticator).
    This should be doable without altering core files, so you can place all your code in the mysite/code directory (maybe in a subfolder named "security").

  • aandrade
    Avatar
    Community Member
    2 Posts

    Re: Extend Authentication Rules Link to this post

    Thanks banal, makes sense I'll give it a crack.
    cheers

  • Dave L
    Avatar
    Community Member
    56 Posts

    Re: Extend Authentication Rules Link to this post

    I've just done this and documented it on my blog.

    1317 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.