Move comment to answer:
I guess you may have permissions that have not been approved by the administrator, or you may not have granted consent to users. Try to follow the steps below:
Grant the administrator consent for the tenant's permissions. You need to execute the administrator's consent url in the browser, and then use the global administrator to log in and authorize:
https://login.microsoftonline.com/{tenant}/v2.0/adminconsent? client_id=6731de76-14a6-49ae-97bc-6eba6914391e &state=12345 &redirect_uri=http://localhost/myapp/permissions &scope=https://graph.microsoft.com/.default
Configure user consent:
Ensure that your application and users are in the same tenant.
https://login.microsoftonline.com/{tenant id}/oauth2/v2.0/authorize
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…