public function AccessTokenRepository::getNewToken in Simple OAuth (OAuth2) & OpenID Connect 8.3
Same name and namespace in other branches
- 8.4 src/Repositories/AccessTokenRepository.php \Drupal\simple_oauth\Repositories\AccessTokenRepository::getNewToken()
- 8.2 src/Repositories/AccessTokenRepository.php \Drupal\simple_oauth\Repositories\AccessTokenRepository::getNewToken()
- 5.x src/Repositories/AccessTokenRepository.php \Drupal\simple_oauth\Repositories\AccessTokenRepository::getNewToken()
File
- src/
Repositories/ AccessTokenRepository.php, line 42
Class
Namespace
Drupal\simple_oauth\RepositoriesCode
public function getNewToken(ClientEntityInterface $client_entity, array $scopes, $user_identifier = NULL) {
$access_token = new AccessTokenEntity();
$access_token
->setClient($client_entity);
foreach ($scopes as $scope) {
$access_token
->addScope($scope);
}
$access_token
->setUserIdentifier($user_identifier);
return $access_token;
}