Allowing 1 user to grant access for organisation to sync calendar events to their calendars

Steve Rad 0 Reputation points
2025-01-28T18:45:31.9133333+00:00

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

Outlook
Outlook
A family of Microsoft email and calendar products.
4,504 questions
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
4,278 questions
Microsoft Partner Center API
Microsoft Partner Center API
Microsoft Partner Center: A Microsoft website for partners that provides access to product support, a partner community, and other partner services.API: A software intermediary that allows two applications to interact with each other.
363 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.