How do I get the authenticated user details?
I've implemented the Demo Umami example and everything seems to be working. However, when I log in, I don't get the authenticated user details (I was expecting at least the uid, username and email) in the response. What am I doing wrong? How do I fix it? Thanks.

I think you need to grant proper permission in Drupal backend to user role that access token belongs to. Be carefull this might have security implications when used wrong.

Thanks @p0zi . I've added a Next.js role with perms as suggested in the screenshot and assigned my user (drupal admin(1) user) to the Next.js role. I cleared Drupal cache and restarted the Next.js frontend site. No change. Could it be something missing in my Consumer settings?

@see: https://github.com/chapter-three/next-drupal/issues/337
Thanks @p0zi. I'll go back to this soon and give that hook in #337 a try.
I made a try yesterday and all works great as @shadcn wrote, here's the full code in custom_module.module:
<?php
use Drupal\simple_oauth\Entities\AccessTokenEntity;
use Drupal\user\Entity\User;
/**
* Implements hook_simple_oauth_private_claims_alter().
*
* Alter the private claims to prepare convert to JWT token.
*
* @param $private_claims
* The private claims array to be altered.
* @param \Drupal\simple_oauth\Entities\AccessTokenEntity $access_token_entity
*
* @see \Drupal\simple_oauth\Entities\AccessTokenEntity::convertToJWT()
*/
function custom_module_simple_oauth_private_claims_alter(&$private_claims, AccessTokenEntity $access_token_entity) {
$user_id = $access_token_entity->getUserIdentifier();
/** @var \Drupal\user\UserInterface $user */
$user = User::load($user_id);
$private_claims = [
'id' => $user->uuid(),
'email' => $user->getEmail(),
'name' => $user->getAccountName(),
];
}
nothing is working really frusted. Poor documentations, this issue is still not solved
Did you implement Drupal side code as custom module?