Files
farmOS-dev/web/modules/simple_oauth/src/Plugin/Oauth2GrantInterface.php
2024-12-10 15:08:16 +01:00

36 lines
782 B
PHP

<?php
namespace Drupal\simple_oauth\Plugin;
use Drupal\Component\Plugin\PluginInspectionInterface;
use Drupal\consumers\Entity\Consumer;
use League\OAuth2\Server\Grant\GrantTypeInterface;
/**
* Defines an interface for OAuth2 Grant plugins.
*/
interface Oauth2GrantInterface extends PluginInspectionInterface {
/**
* Gets the grant object.
*
* @param \Drupal\consumers\Entity\Consumer $client
* The consumer entity.
*
* @return \League\OAuth2\Server\Grant\GrantTypeInterface
* The grant type object.
*
* @throws \Exception
*/
public function getGrantType(Consumer $client): GrantTypeInterface;
/**
* Get the grant type label.
*
* @return string
* Returns the grant type label.
*/
public function label(): string;
}