grahamr975 / EWS-Office365-Contact-Sync

Uses Exchange Web Services to synchronize a Global Address List in Office 365 to a user's mailbox
MIT License
94 stars 21 forks source link

Folder 'Forbidden Access' #65

Closed endee63 closed 1 year ago

endee63 commented 1 year ago

Running the script results in an error at the time that it tries to sync contacts into the designated folder. 'Error 403 - Fobidden'. Script is actually OK, the tutorial on registering the Azure app is missing one of the API permissions that need to be granted. Need the 'full_access_as_app' API/permission in order for writeback into Exchange contact folder to work. image

grahamr975 commented 1 year ago

This is already documented. Look in the addendums section in this script's README.

When updating the app's Manifest, insert the below code for requiredResourceAccess instead of following what the tutorial suggests. The below version also includes permissions for acting as an EWS Application.

            "requiredResourceAccess": [
            {
                "resourceAppId": "00000002-0000-0ff1-ce00-000000000000",
                "resourceAccess": [
                    {
                        "id": "dc50a0fb-09a3-484d-be87-e023b12c6440",
                        "type": "Role"
                    },
                    {
                        "id": "dc890d15-9560-4a4c-9b7f-a736ec74ec40",
                        "type": "Role"
                    }
                ]
            }
        ]