An API that connects multiple Microsoft services, enabling data access and automation across platforms
Revoke access for application using node
Hello guys,
I am developing a node application in which I need to access users' outlook calendar events. The main purpose of my application is that if the client allow access to their outlook calendar then my application will get all events of the outlook calendar and after some time if the client revokes access then my application should not able to access outlook calendar events.
Here I can able to gain access from users to access events via graph API, but I am not able to find any way to revoke the access.
I've tried below two APIs/method
/me/invalidateAllRefreshTokens
/me/revokeSignInSessions
But getting errors for both that :
No HTTP resource was found that matches the request URI 'https://outlook.office365.com:444/profile/v1.0/users('CID:xxxx....xxxx')/profile/revokeSignInSessions?api-version=AGSV1-internal'.
what is the reason for this error?
Also have one confusion related account types, I have 2 accounts:
- Create application and register under azure portal: Personal account
- Need to give access from application as client account: Personal account
have any suggestions where I should use work account and personal account to access api?
or is there any other way to revoke access or consent?