Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions src/Plugin/authentication/OAuth2ServerAuthentication.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,19 @@ protected function getOAuth2Info(RequestInterface $request) {

$plugin_definition = ResourcePluginManager::create('cache', $request)->getDefinition($plugin_id);

if (empty($plugin_definition['oauth2Server'])) {
return NULL;
// First check if we have an array with OAuth2 info and use if available.
if (!empty($plugin_definition['oauth2Info']) && !empty($plugin_definition['oauth2Info']['server'])) {
return $plugin_definition['oauth2Info'] + ['scope' => ''];
}

// Check for OAuth2 properties at top level for legacy support.
if (!empty($plugin_definition['oauth2Server'])) {
$server = $plugin_definition['oauth2Server'];
$scope = !empty($plugin_definition['oauth2Scope']) ? $plugin_definition['oauth2Scope'] : '';
return ['server' => $server, 'scope' => $scope];
}

$server = $plugin_definition['oauth2Server'];
$scope = !empty($plugin_definition['oauth2Scope']) ? $plugin_definition['oauth2Scope'] : '';
return ['server' => $server, 'scope' => $scope];
return NULL;
}

/**
Expand Down