ayi I had the same issue and managed to make it work by removing the trailing "/" from the resource parameter when requesting an access token. So in my case the resource https://graph.microsoft.com/ should be written https://graph.microsoft.com