interface KeyAuthInterface in Key auth 8
Interface KeyAuthInterface.
Hierarchy
- interface \Drupal\key_auth\KeyAuthInterface
Expanded class hierarchy of KeyAuthInterface
All classes that implement KeyAuthInterface
3 files declare their use of KeyAuthInterface
- DisallowKeyAuthRequests.php in src/
PageCache/ DisallowKeyAuthRequests.php - KeyAuth.php in src/
Authentication/ Provider/ KeyAuth.php - UserKeyAuthForm.php in src/
Form/ UserKeyAuthForm.php
File
- src/
KeyAuthInterface.php, line 11
Namespace
Drupal\key_authView source
interface KeyAuthInterface {
/**
* Get the key provided in the current request.
*
* @param \Symfony\Component\HttpFoundation\Request $request
* The current request.
*
* @return string|false
* The API key provided in the request, or FALSE if there was not one.
*/
public function getKey(Request $request);
/**
* Load the user associated with a given key.
*
* @param string $key
* The API key to match to a user.
*
* @return \Drupal\user\Entity\User|null
* The matching user entity, or NULL if there was no match.
*/
public function getUserByKey($key);
/**
* Determine if a user has access to use key authentication.
*
* @param \Drupal\user\UserInterface $user
* The user being authenticated.
*
* @return bool
* TRUE if the user has access, otherwise FALSE.
*/
public function access(UserInterface $user);
/**
* Generate a new unique key.
*
* @return string
* An API key.
*/
public function generateKey();
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
KeyAuthInterface:: |
public | function | Determine if a user has access to use key authentication. | 1 |
KeyAuthInterface:: |
public | function | Generate a new unique key. | 1 |
KeyAuthInterface:: |
public | function | Get the key provided in the current request. | 1 |
KeyAuthInterface:: |
public | function | Load the user associated with a given key. | 1 |