Version: current

# Class Authenticator

Abstract base class for an authentication method

This class is used as a base class for the different authentication methods like `MemberAuthenticator` or OpenIDAuthenticator.

  Object
  Authenticator

### Direct known subclasses

`MemberAuthenticator`

Abstract
Package: sapphire\security
Author: Markus Lanthaler <markus@silverstripe.com>
Located at sapphire/security/Authenticator.php

## Methods summary

`abstract public static boolean|`Member`` | # `authenticate( array $RAW_data, `Form` $form = null )` Method to authenticate an user Method to authenticate an user #### Parameters $RAW_data array $RAW_data Raw data to authenticate the user $form Form $form Optional: If passed, better error messages can be produced by using `Form::sessionMessage()` #### Returns `boolean|`Member`` Returns FALSE if authentication fails, otherwise the member object
`abstract public static `Form`` | # `get_login_form( `Controller` $controller )` Method that creates the login form for this authentication method Method that creates the login form for this authentication method #### Parameters $controller Controller The parent controller, necessary to create the appropriate form action tag #### Returns ``Form`` Returns the login form to use with this authentication method
`abstract public static string` | # `get_name( )` Get the name of the authentication method Get the name of the authentication method #### Returns `string` Returns the name of the authentication method.
`public static` | # `register( mixed $authenticator )`
`public static boolean` | # `register_authenticator( string $authenticator )` Register a new authenticator Register a new authenticator The new authenticator has to exist and to be derived from the `Authenticator`. Every authenticator can be registered only once. #### Parameters $authenticator string $authenticator Name of the authenticator class to register #### Returns `boolean` Returns TRUE on success, FALSE otherwise.
`public static` | # `unregister( mixed $authenticator )`
`public static boolean` | # `unregister_authenticator( string $authenticator )` Remove a previously registered authenticator Remove a previously registered authenticator #### Parameters $authenticator string $authenticator Name of the authenticator class to register #### Returns `boolean` Returns TRUE on success, FALSE otherwise.
`public static boolean` | # `is_registered( string $authenticator )` Check if a given authenticator is registered Check if a given authenticator is registered #### Parameters $authenticator string $authenticator Name of the authenticator class to check #### Returns `boolean` Returns TRUE if the authenticator is registered, FALSE otherwise.
`public static array` | # `get_authenticators( )` Get all registered authenticators Get all registered authenticators #### Returns `array` Returns an array with the class names of all registered authenticators.
`public static` | # `set_default_authenticator( string $authenticator )` Set a default authenticator (shows first in tabs) Set a default authenticator (shows first in tabs) #### Parameters $authenticator string
`public static string` | # `get_default_authenticator( )` #### Returns `string` string
`protected static boolean` | # `on_register( )` Callback function that is called when the authenticator is registered Callback function that is called when the authenticator is registered Use this method for initialization of a newly registered authenticator. Just overload this method and it will be called when the authenticator is registered. If the method returns FALSE, the authenticator won't be registered! #### Returns `boolean` Returns TRUE on success, FALSE otherwise.
`protected static boolean` | # `on_unregister( )` Callback function that is called when an authenticator is removed. Callback function that is called when an authenticator is removed. #### Returns `boolean` bool

### Methods inherited from Object

`__call()`, `__construct()`, `__toString()`, `__wakeup()`, `addMethodsFrom()`, `addStaticVars()`, `addWrapperMethod()`, `add_extension()`, `add_static_var()`, `allMethodNames()`, `cacheToFile()`, `cacheToFileWithArgs()`, `clearCache()`, `combined_static()`, `create()`, `createMethod()`, `create_from_string()`, `defineMethods()`, `exists()`, `extInstance()`, `extend()`, `getCustomClass()`, `getExtensionInstance()`, `getExtensionInstances()`, `get_extensions()`, `get_static()`, `hasExtension()`, `hasMethod()`, `has_extension()`, `invokeWithExtensions()`, `is_a()`, `loadCache()`, `parentClass()`, `parse_class_spec()`, `remove_extension()`, `sanitiseCachename()`, `saveCache()`, `set_stat()`, `set_static()`, `set_uninherited()`, `stat()`, `strong_create()`, `uninherited()`, `uninherited_static()`, `useCustomClass()`

### Magic methods summary

## Properties summary

### Properties inherited from Object

`$class`, `$extension_instances`, `$extensions`

[Raise a SilverStripe Framework issue/bug](https://github.com/silverstripe/silverstripe-framework/issues/new)
- [Raise a SilverStripe CMS issue/bug](https://github.com/silverstripe/silverstripe-cms/issues/new)
- Please use the Silverstripe Forums to ask development related questions. -