public function AccessTokenRepository::getNewToken in Simple OAuth (OAuth2) & OpenID Connect 5.x
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()
- 8.3 src/Repositories/AccessTokenRepository.php \Drupal\simple_oauth\Repositories\AccessTokenRepository::getNewToken()
File
- src/
Repositories/ AccessTokenRepository.php, line 62
Class
- AccessTokenRepository
- The access token repository.
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;
}