[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/libraries/src/Helper/ -> AuthenticationHelper.php (summary)

Joomla! Content Management System

Copyright: (C) 2016 Open Source Matters, Inc.
License: GNU General Public License version 2 or later; see LICENSE.txt
File Size: 155 lines (6 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 2 functions

  getTwoFactorMethods()
  getLoginButtons()

Functions
Functions that are not part of a class:

getTwoFactorMethods()   X-Ref
No longer used

return: array  Always empty

getLoginButtons(string $formId)   X-Ref
Get additional login buttons to add in a login module. These buttons can be used for
authentication methods external to Joomla such as WebAuthn, login with social media
providers, login with third party providers or even login with third party Single Sign On
(SSO) services.

Button definitions are returned by the onUserLoginButtons event handlers in plugins. By
default, only system and user plugins are taken into account. The former because they are
always loaded. The latter are explicitly loaded in this method.

The onUserLoginButtons event handlers must conform to the following method definition:

public function onUserLoginButtons(string $formId): array

The onUserLoginButtons event handlers must return a simple array containing 0 or more button
definitions.

Each button definition is a hash array with the following keys:

* `label`   The translation string used as the label and title of the button. Required
* `id`      The HTML ID of the button. Required.
* `tooltip` (optional) The translation string used as the alt tag of the button's image
* `onclick` (optional) The onclick attribute, used to fire a JavaScript event. Not
recommended.
* `data-*`  (optional) Data attributes to pass verbatim. Use these and JavaScript to handle
the button.
* `icon`    (optional) A CSS class for an optional icon displayed before the label; has
precedence over 'image'
* `image`   (optional) An image path for an optional icon displayed before the label
* `class`   (optional) CSS class(es) to be added to the button

You can find a real world implementation of the onUserLoginButtons plugin event in the
system/webauthn plugin.

You can find a real world implementation of consuming the output of this method in the
modules/mod_login module.

Third party developers implementing a login module or a login form in their component are
strongly advised to call this method and consume its results to display additional login
buttons. Not doing that means that you are not fully compatible with Joomla 4.

param: string  $formId  The HTML ID of the login form container. Use it to filter when and
return: array  Button definitions.



Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer