class UserAuth implements UserAuthInterface (View source)

Validates user authentication credentials.

Properties

protected EntityTypeManagerInterface $entityTypeManager

The entity type manager.

protected PasswordInterface $passwordChecker

The password hashing service.

Methods

__construct(EntityTypeManagerInterface $entity_type_manager, PasswordInterface $password_checker)

Constructs a UserAuth object.

int|bool
authenticate(string $username, string $password)

Validates user authentication credentials.

Details

__construct(EntityTypeManagerInterface $entity_type_manager, PasswordInterface $password_checker)

Constructs a UserAuth object.

Parameters

EntityTypeManagerInterface $entity_type_manager

The entity type manager.

PasswordInterface $password_checker

The password service.

int|bool authenticate(string $username, string $password)

Validates user authentication credentials.

Parameters

string $username

The user name to authenticate.

string $password

A plain-text password, such as trimmed text from form values.

Return Value

int|bool

The user's uid on success, or FALSE on failure to authenticate.