aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-11-05 17:38:21 -0800
committerredmatrix <redmatrix@redmatrix.me>2015-11-05 17:38:21 -0800
commit6b26b4e3b817ead75f2aba00dc20b468a2df82cb (patch)
tree2a4fb1ca9ed5a5088567408440d89f01277d54dd
parent7df92ba62c2d6a00afda747a38fc099720009685 (diff)
downloadvolse-hubzilla-6b26b4e3b817ead75f2aba00dc20b468a2df82cb.tar.gz
volse-hubzilla-6b26b4e3b817ead75f2aba00dc20b468a2df82cb.tar.bz2
volse-hubzilla-6b26b4e3b817ead75f2aba00dc20b468a2df82cb.zip
the journey of 1000 miles begins with a single step
-rw-r--r--doc/hook/authenticate.bb28
1 files changed, 28 insertions, 0 deletions
diff --git a/doc/hook/authenticate.bb b/doc/hook/authenticate.bb
index 2e824f082..eb8071e73 100644
--- a/doc/hook/authenticate.bb
+++ b/doc/hook/authenticate.bb
@@ -1 +1,29 @@
[h2]authenticate[/h2]
+
+Invoked when a POST request is made with non-null $_POST['auth-params'] such as from the login form.
+If the hook handler does not set the 'authenticated' parameter of the passed array, normal login functions continue;
+
+The 'user_record' is in fact an account DB record. To provide automatic provisioning of accounts from other authentication realms, this record should be generated and stored during the verification phase.
+
+
+[code]
+ $addon_auth = array(
+ 'username' => trim($_POST['username']),
+ 'password' => trim($_POST['password']),
+ 'authenticated' => 0,
+ 'user_record' => null
+ );
+
+ /**
+ *
+ * A plugin indicates successful login by setting 'authenticated' to non-zero value and returning a user record
+ * Plugins should never set 'authenticated' except to indicate success - as hooks may be chained
+ * and later plugins should not interfere with an earlier one that succeeded.
+ *
+ */
+
+ call_hooks('authenticate', $addon_auth);
+[/code]
+
+
+See include/auth.php