Allowing 1 user to grant access for organisation to sync calendar events to their calendars
We're currently building a system that will allow syncing calendar events into user's outlook calendars. We're first sending users to authorise themselves using this endpoint https://login.microsoftonline.com/common/adminconsent?client_id=our-client-id&redirect_uri=https://localhost/some/path
, with application scopes, not delegated configured in our organisation.
The first problem we get is this error 'Selected user account does not exist in tenant. The account needs to be added as an external user in the tenant first'. I'm not exactly sure what this means, I've setup the application in my entra account, I'm trying to login with another user from another organisation like a real user would to grant access to my organisation's calendars, but I then get this error. How do I get around this?
My understanding is once we have organisations grant us access using that endpoint above, we can then obtain an access token via the client_credentials grant. We could then use the /organisation
endpoint to get a list of the organisations we have access to. However once we have the organisations, what endpoint do we then use to find all of the users within that organisation so we can access their calendars?
Thanks