I am creating a webpart for SharePoint Online which accesse the user's calendar through the Microsoft Graph API.
In order to get the
access_token, my webpart needs to open a new browser window where the user logs in with their Microsoft account. I am using OAuth v2.
However, my customer says this is not necessary because the user is already logged into SharePoint online, therefore there is no need to log in again an there must be a way to get the access token without having to log in again.
Is there a way to get the access_token for the Microsoft Graph API from inside a SharePoint online page without prompting the user and without opening that Microsoft account login window?