class Implicit in Simple OAuth (OAuth2) & OpenID Connect 8.4
Same name and namespace in other branches
- 5.x src/Plugin/Oauth2Grant/Implicit.php \Drupal\simple_oauth\Plugin\Oauth2Grant\Implicit
The implicit grant plugin.
Plugin annotation
@Oauth2Grant(
id = "implicit",
label = @Translation("Implicit")
)
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\simple_oauth\Plugin\Oauth2GrantBase implements Oauth2GrantInterface
- class \Drupal\simple_oauth\Plugin\Oauth2Grant\Implicit
- class \Drupal\simple_oauth\Plugin\Oauth2GrantBase implements Oauth2GrantInterface
Expanded class hierarchy of Implicit
File
- src/
Plugin/ Oauth2Grant/ Implicit.php, line 19
Namespace
Drupal\simple_oauth\Plugin\Oauth2GrantView source
class Implicit extends Oauth2GrantBase {
/**
* The expiration date time.
*
* @var \DateTime
*/
protected $expiration;
/**
* Class constructor.
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition, ConfigFactoryInterface $config_factory) {
// If the implicit grant is not enabled, then bail.
$enabled = $config_factory
->get('simple_oauth.settings')
->get('use_implicit');
if (!$enabled) {
throw new PluginNotFoundException('implicit');
}
parent::__construct($configuration, $plugin_id, $plugin_definition);
$settings = $config_factory
->get('simple_oauth.settings');
$this->expiration = new \DateInterval(sprintf('PT%dS', $settings
->get('access_token_expiration')));
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new static($configuration, $plugin_id, $plugin_definition, $container
->get('config.factory'));
}
/**
* {@inheritdoc}
*/
public function getGrantType() {
return new ImplicitGrant($this->expiration);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Implicit:: |
protected | property | The expiration date time. | |
Implicit:: |
public static | function |
Creates an instance of the plugin. Overrides Oauth2GrantBase:: |
|
Implicit:: |
public | function |
Gets the grant object. Overrides Oauth2GrantInterface:: |
|
Implicit:: |
public | function |
Class constructor. Overrides PluginBase:: |
|
PluginBase:: |
protected | property | Configuration information passed into the plugin. | 1 |
PluginBase:: |
protected | property | The plugin implementation definition. | 1 |
PluginBase:: |
protected | property | The plugin_id. | |
PluginBase:: |
constant | A string which is used to separate base plugin IDs from the derivative ID. | ||
PluginBase:: |
public | function |
Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the definition of the plugin implementation. Overrides PluginInspectionInterface:: |
3 |
PluginBase:: |
public | function |
Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface:: |
|
PluginBase:: |
public | function | Determines if the plugin is configurable. |