I'm doing Office365 account-based login functionality through SharePoint on PHP.
After doing that I was able to login and get the SPAppToken and SPSiteUrl
I use them to get the refreshToken, then I get the accessToken based on the refreshToken
Continue to trying to get the information of the logged in user but failed. Information is as follows:
URL: https://mypage.sharepoint.com/_api/web/currentuser
Method: GET
Headers:
Accept: application/json; odata=verbose
Authorization: Bearer + accessToken
Result:
{
"error": {
"code": "-2147024891, System.UnauthorizedAccessException",
"message": {
"lang": "ja-JP",
"value": "Attempted to perform an unauthorized operation."
}
}
}
I don't know what to do to be able to get my own credentials API, please help, I think I need somewhere to give permission, but I don't know where it is! Thanks everyone!