Username Authentication for SilverStripe Websites

Posted by Jeremy Shipman on 5 January 2010 | 1 Comments

Tags: ,

This set of instructions and code will help you to set up username authentication for your SilverStripe website. Note that the SilverStripe CMS has typically relied on E-Mail authentication, so this could cause problems if developers have assumed email authentication. I've provided a patch and information for issues I've found so far.

Use this code at your own risk. Please let me know if you find any bugs with the code, or the instructions are not clear.

Download & install my auth_username module

In your _config.php optionally add:

// makes username authentication default
Authenticator::set_default_authenticator("UsernameAuthenticator");

// removes default email + password authentication
Authenticator::unregister("MemberAuthenticator");

Patch your MemberTableField & SecurityAdmin to include username support. If you don't patch these files, you won't be able to add members to groups properly in the CMS Security section. Download diff.

To apply patch on unix:

  1. Upload the patch to your SilverStripe root directory
  2. Run the command: patch -p0 -i membertablefieldpatch.diff

Generate usernames for your users. I've provided a function on the member decorator class 'UsernameMemberDecorator' that generates a username from the user's first name and surname.

Known issues:

  • Can't change default admin member's details properly.

TrackBacks

No TrackBacks have been submitted for this page.

Trackback URL for this page.

Post your comment

Comments

  • Not sure what this module does. Does this allow a person to register to the system or hidden page?

    Posted by Steve, 13/02/2010 5:41am (25 days ago)