Vufind: The library OPAC meets Web 2.0


Building an Authentication Handler

VuFind contains a class-based mechanism for authenticating users.

Architecture

All of VuFind's authentication code can be found in the web/sys/authn directory.

All authentication handlers implement the Authentication interface found in web/sys/authn/Interface.php.

Authentication handlers are instantiated by the AuthenticationFactory class found in web/sys/authn/AuthenticationFactory.php.

Building an Authentication Handler

  • Create a new module in web/sys/authn for your new authentication method.
  • Write a class in this new file that implements the Authentication interface.
  • Modify the AuthenticationFactory class so that it knows how to construct your new class. Starting with VuFind 1.1, this will be unnecessary as long as you name your class according to this pattern: [config.ini value]Authentication; i.e. MyNewAuthentication will load automatically if you use “MyNew” as the value in config.ini.

Notes

  • As of this writing, the web/sys/authn directory contains some utility code (configuration parsers, exception classes) that should probably be moved to a more generic location in the future. If you add new support classes, please consider putting them somewhere more appropriate.
 
building_an_authentication_handler.txt · Last modified: 2011/01/05 10:53 by demiankatz
 
Recent changes RSS feed Driven by DokuWiki