[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/plugins/multifactorauth/webauthn/src/Helper/ -> Credentials.php (summary)

(no description)

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

Defines 8 functions

  requestAttestation()
  verifyAttestation()
  requestAssertion()
  verifyAssertion()
  getAvatar()
  getUserEntity()
  getWebauthnServer()
  getPubKeyDescriptorsForUser()

Functions
Functions that are not part of a class:

requestAttestation(User $user)   X-Ref
Authenticator registration step 1: create a public key for credentials attestation.

The result is a JSON string which can be used in Javascript code with navigator.credentials.create().

param: User   $user   The Joomla user to create the public key for
return: string

verifyAttestation(string $data)   X-Ref
Authenticator registration step 2: verify the credentials attestation by the authenticator

This returns the attested credential data on success.

An exception will be returned on error. Also, under very rare conditions, you may receive NULL instead of
attested credential data which means that something was off in the returned data from the browser.

param: string   $data   The JSON-encoded data returned by the browser during the authentication flow
return: AttestedCredentialData|null

requestAssertion(int $userId)   X-Ref
Authentication step 1: create a challenge for key verification

param: int  $userId  The user ID to create a WebAuthn PK for
return: string

verifyAssertion(string $response)   X-Ref
Authentication step 2: Checks if the browser's response to our challenge is valid.

param: string   $response   Base64-encoded response
return: void

getAvatar(User $user, int $size = 64)   X-Ref
Get the user's avatar (through Gravatar)

param: User   $user   The Joomla user object
param: int    $size   The dimensions of the image to fetch (default: 64 pixels)
return: string  The URL to the user's avatar

getUserEntity(User $user)   X-Ref
Get a WebAuthn user entity for a Joomla user

param: User   $user  The user to get an entity for
return: PublicKeyCredentialUserEntity

getWebauthnServer(?int $userId)   X-Ref
Get the WebAuthn library server object

param: int|null  $userId  The user ID holding the list of valid authenticators
return: Server

getPubKeyDescriptorsForUser(User $user)   X-Ref
Returns an array of the PK credential descriptors (registered authenticators) for the given user.

param: User   $user  The user to get the descriptors for
return: PublicKeyCredentialDescriptor[]



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