Joomla CMS  4.2.2
Documentation des API du CMS Joomla en version 4.2.2
Référence de la classe Authentication

Fonctions membres publiques

 __construct (ApplicationInterface $app=null, SessionInterface $session=null, PublicKeyCredentialSourceRepository $credRepo=null, ?MetadataStatementRepository $mdsRepo=null)
 
 getKnownAuthenticators ()
 
 getCredentialsRepository ()
 
 getMetadataRepository ()
 
 getPubKeyCreationOptions (User $user)
 
 getPubkeyRequestOptions (User $user)
 
 validateAssertionResponse (string $data, User $user)
 
 hasAttestationSupport ()
 
 setAttestationSupport (bool $attestationSupport)
 

Fonctions membres privées

 getSiteIcon ()
 
 getUserEntity (User $user)
 
 getAvatar (User $user, int $size=64)
 
 getPubKeyDescriptorsForUser (User $user)
 
 getPKCredentialRequestOptions ()
 
 getWebauthnServer ()
 

Attributs privés

 $credentialsRepository
 
 $app
 
 $session
 
 $metadataRepository
 
 $attestationSupport = true
 

Description détaillée

Helper class to aid in credentials creation (link an authenticator to a user account)

Depuis
4.2.0

Documentation des constructeurs et destructeur

◆ __construct()

__construct ( ApplicationInterface  $app = null,
SessionInterface  $session = null,
PublicKeyCredentialSourceRepository  $credRepo = null,
?MetadataStatementRepository  $mdsRepo = null 
)

Public constructor.

Paramètres
ApplicationInterface | null$appThe app we are running in
SessionInterface | null$sessionThe app session object
PublicKeyCredentialSourceRepository | null$credRepoCredentials repo
MetadataStatementRepository | null$mdsRepoAuthenticator metadata repo
Depuis
4.2.0

Références $app.

Documentation des fonctions membres

◆ getAvatar()

getAvatar ( User  $user,
int  $size = 64 
)
private

Get the user's avatar (through Gravatar)

Paramètres
User$userThe Joomla user object
int$sizeThe dimensions of the image to fetch (default: 64 pixels)
Renvoie
string The URL to the user's avatar
Depuis
4.2.0

Références $size, $user, et Uri\getInstance().

◆ getCredentialsRepository()

getCredentialsRepository ( )

Returns the Public Key credential source repository object

Renvoie
PublicKeyCredentialSourceRepository|null
Depuis
4.2.0

◆ getKnownAuthenticators()

getKnownAuthenticators ( )

Get the known FIDO authenticators and their metadata

Renvoie
object[]
Depuis
4.2.0

Références $image, $return, Text\_(), HTMLHelper\_(), JPATH_BASE, JPATH_ROOT, et Uri\root().

◆ getMetadataRepository()

getMetadataRepository ( )

Returns the authenticator metadata repository object

Renvoie
MetadataStatementRepository|null
Depuis
4.2.0

◆ getPKCredentialRequestOptions()

getPKCredentialRequestOptions ( )
private

Retrieve the public key credential request options saved in the session.

If they do not exist or are corrupt it is a hacking attempt and we politely tell the attacker to go away.

Renvoie
PublicKeyCredentialRequestOptions
Exceptions
Exception
Depuis
4.2.0

Références Text\_(), Log\add(), Log\NOTICE, et null.

◆ getPubKeyCreationOptions()

getPubKeyCreationOptions ( User  $user)

Generate the public key creation options.

This is used for the first step of attestation (key registration).

The PK creation options and the user ID are stored in the session.

Paramètres
User$userThe Joomla user to create the public key for
Renvoie
PublicKeyCredentialCreationOptions
Exceptions
Exception
Depuis
4.2.0

We will only ask for attestation information if our MDS is guaranteed not empty.

We check that by trying to load a known good AAGUID (Yubico Security Key NFC). If it's missing, we have failed to load the MDS data e.g. we could not contact the server, it was taking too long, the cache is unwritable etc. In this case asking for attestation conveyance would cause the attestation to fail (since we cannot verify its signature). Therefore we have to ask for no attestation to be conveyed. The downside is that in this case we do not have any information about the make and model of the authenticator. So be it! After all, that's a convenience feature for us.

Références $user, PublicKeyCredentialCreationOptions\ATTESTATION_CONVEYANCE_PREFERENCE_DIRECT, PublicKeyCredentialCreationOptions\ATTESTATION_CONVEYANCE_PREFERENCE_NONE, AuthenticatorSelectionCriteria\AUTHENTICATOR_ATTACHMENT_NO_PREFERENCE, et AuthenticatorSelectionCriteria\USER_VERIFICATION_REQUIREMENT_PREFERRED.

◆ getPubKeyDescriptorsForUser()

getPubKeyDescriptorsForUser ( User  $user)
private

Returns an array of the PK credential descriptors (registered authenticators) for the given user.

Paramètres
User$userThe Joomla user to get the PK descriptors for
Renvoie
PublicKeyCredentialDescriptor[]
Depuis
4.2.0

Références $user.

◆ getPubkeyRequestOptions()

getPubkeyRequestOptions ( User  $user)

Get the public key request options.

This is used in the first step of the assertion (login) flow.

Paramètres
User$userThe Joomla user to get the PK request options for
Renvoie
PublicKeyCredentialRequestOptions
Exceptions
Exception
Depuis
4.2.0

Références $user, Log\add(), Log\DEBUG, et PublicKeyCredentialRequestOptions\USER_VERIFICATION_REQUIREMENT_PREFERRED.

◆ getSiteIcon()

getSiteIcon ( )
private

Try to find the site's favicon in the site's root, images, media, templates or current template directory.

Renvoie
string|null
Depuis
4.2.0

Références $path, Uri\base(), JPATH_BASE, et null.

◆ getUserEntity()

getUserEntity ( User  $user)
private

Returns a User Entity object given a Joomla user

Paramètres
User$userThe Joomla user to get the user entity for
Renvoie
PublicKeyCredentialUserEntity
Depuis
4.2.0

Références $user.

◆ getWebauthnServer()

getWebauthnServer ( )
private

Get the WebAuthn library's Server object which facilitates WebAuthn operations

Renvoie
Server
Exceptions
Exception
Depuis
4.2.0

Références Uri\getInstance().

◆ hasAttestationSupport()

hasAttestationSupport ( )

Get the authentiactor attestation support.

Renvoie
boolean
Depuis
4.2.0

◆ setAttestationSupport()

setAttestationSupport ( bool  $attestationSupport)

Change the authenticator attestation support.

Paramètres
bool$attestationSupportThe desired setting
Renvoie
void
Depuis
4.2.0

◆ validateAssertionResponse()

validateAssertionResponse ( string  $data,
User  $user 
)

Validate the authenticator assertion.

This is used in the second step of the assertion (login) flow. The server verifies that the assertion generated by the authenticator has not been tampered with.

Paramètres
string$dataThe data
User$userThe user we are trying to log in
Renvoie
PublicKeyCredentialSource
Exceptions
Exception
Depuis
4.2.0

Références $data, $user, Text\_(), Log\add(), ServerRequestFactory\fromGlobals(), Log\NOTICE, et null.

Documentation des champs

◆ $app

$app
private

◆ $attestationSupport

$attestationSupport = true
private

◆ $credentialsRepository

$credentialsRepository
private

◆ $metadataRepository

$metadataRepository
private

◆ $session

$session
private

La documentation de cette classe a été générée à partir du fichier suivant :