Maybe these following modules will help you, I was once stuck with the same issue for the authentication. My Drupal application was decoupled (Frontend - Vue and Backend - Drupal 9)
I installed the following contributed modules:
JWT, and Get JWT on Login.
And just call the login (https://your-drupal-site/user/login?_format=json) endpoint with provided credentials, it will send you back the user's details:
{
"current_user": {
"uid": "1",
"name": "admin"
},
"csrf_token": "UlGb7fak5ZS-r1BRistBh4IWLm_Z7F1xMpY3KYTGqcU",
"logout_token": "7AvbnHgr9iDxIDVertHTI3PMX2-Shd6sjuN8hNHrHv8F",
"access_token": "eyJ0eXAiOiJKV1QiLDJhbGciOiJIUzUxMiJ9.eyJpYXQiOjE1NDg2NzA3NDUsImV4cCI6MTU0ODY3NDM0NSwiZHJ1cGAsIjp7InVpZCI6IjYifX0.cnG6atSLYrRh6D05LZg9RwrJJdYoJfTBXTUZboPhJH3lYf640FmQTkJwwy9E8kg7ot59qyb5qtgIewM3R1KCDw"
}