I registered an application in Azure Portal and added to it 2 APIs: Azure Active Directory and Microsoft Sharepoint Online with some permissions. I followed the steps from: https://docs.microsoft.com/en-us/outlook/rest/java-tutorial#register-the-app.
The problem is that when I make a request with the Bearer token to the Sharepoint API it gives me an Unauthorized error: 401:
401 Unauthorized x-ms-diagnostics: 3000006;reason="Token contains invalid signature.";category="invalid_client" {"error_description":"Invalid issuer or signature."}
But when I got the access token I have the these scopes:
"token_type":"Bearer","scope":"AllSites.Manage AllSites.Read AllSites.Write Mail.Read MyFiles.Read MyFiles.Write User.Read"
Any idea?