DokuWiki

It's better when it's simple

User Tools

Site Tools


devel:event:auth_login_check

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
devel:event:auth_login_check [2011-11-28 11:57]
andi [AUTH_LOGIN_CHECK]
devel:event:auth_login_check [2014-12-18 00:47]
Klap-in
Line 8: Line 8:
 ---- ----
  
-This Event allows to provide authentication on a per request basis by using signatures or tokens instead of the default DokuWiki login or cookies.+This Event allows to provide authentication on a per request basis by using signatures or tokens instead of the default DokuWiki login or cookies. The event is triggered by [[xref>auth_setup()]] in [[xref>inc/auth.php]] and by [[xref>login()]] in [[xref>inc/RemoteAPICore.php]].
  
 Since 2010-01-29, there is an ''AFTER'' event available. Since 2010-01-29, there is an ''AFTER'' event available.
  
-The global ''$AUTH_ACL'' is not set up when this event is triggered.+The global [[xref>$AUTH_ACL]] is not set up when this event is triggered.
  
 ===== Passed Data ===== ===== Passed Data =====
 +The passed [[xref>Doku_Event]] object has the fields: ''$data'' and ''$result''.
  
-''$data'' is an associative array containing ''user''''password''''sticky'' and ''silent'' login parameters.+The field ''$data'' is an associative array containing the login parameters as entries: 
 +  * ''user'' -- User name 
 +  * ''password'' -- Password 
 +  * ''sticky''  -- Cookie should not expire 
 +  * ''silent'' -- Don't show error on bad authentication
  
-If the Event handler does not ''$event->preventDefault()'' those parameters are passed to auth_login().+If the BEFORE event handler does not ''%%$event->preventDefault()%%'' those parameters are passed to [[xref>auth_login()]] via a wrapper function. The parameters in the ''$data'' field can be modified here as well. 
 + 
 +The ''$result'' field is set by the default function to true on successful authentication, otherwise false. 
 +The AFTER event handler can changes this return value, but the default login action is then already tried.
  
 ===== Plugins handling this event ===== ===== Plugins handling this event =====
Line 24: Line 32:
 The following plugins are known to handle this event and their source code may be a good start for understanding and implementing a handler yourself. The following plugins are known to handle this event and their source code may be a good start for understanding and implementing a handler yourself.
  
 +  * [[plugin:authad]], [[plugin:tokenbucketauth]], [[plugin:logautherror]], [[plugin:fedauth]], [[plugin:maintenancemessage]], [[plugin:zenlogin]], [[plugin:securelogin]]
   * [[http://rg42.org/wiki/dokuoauth_simple|Oauth simple]] (simple: hardcoded tokens) for the [[http://oauth.net|OAuth]] API   * [[http://rg42.org/wiki/dokuoauth_simple|Oauth simple]] (simple: hardcoded tokens) for the [[http://oauth.net|OAuth]] API
   * [[http://rg42.org/wiki/dokuoauth|Oauth]] - work in progress   * [[http://rg42.org/wiki/dokuoauth|Oauth]] - work in progress
Line 31: Line 40:
   * [[devel:Action Plugins]]   * [[devel:Action Plugins]]
   * [[devel:Events]]   * [[devel:Events]]
- 
devel/event/auth_login_check.txt · Last modified: 2018-12-08 15:00 by torpedo