Hi @Terry Chan ,
You could get the access Token of a specific account as the below:
- Get a delegated auth token from graph as you normally would (https://learn.microsoft.com/en-us/graph/auth-v2-user)
- Use the refresh_token you got and exchange it for an SPO access token by calling the auth endpoint again: POST https://login.microsoftonline.com/{tenant}/oauth2/v2.0/token
With the following form data:
client_id=<APP ID>
client_secret=<APP SECRET>
refresh_token=<REFRESH TOKEN FROM ABOVE>
grant_type=refresh_token
scope=https://<tenant>.sharepoint.com/Sites.FullControl.All
3.Take the access token and call the SPO API
Make sure that you app is granted enough permissions.
Reference: https://stackoverflow.com/questions/63321532/sharepoint-rest-api-how-to-get-access-token
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.