Problem with Hugging Face OAuth API

Hello,

I am working on a school project where I need to perform authentications with third-party services, and in my case, I am using the Hugging Face service. The OAuth2.0 process is completed successfully, but when I try to make a request to the endpoint: https://huggingface.co/api/whoami-v2
with the access_token obtained from the post request to https://huggingface.co/oauth/token
I get an error:
{
“error”: “Invalid username or password.”
}
I have double-checked everything, the token, the parameters, etc., but nothing works; I still get this response. However, when I make exactly the same request with a personal access token generated in the settings of my account, it works correctly. How can I solve this problem?