Is it possible to use getSchedule API on user from different tenants?

Yanitra Dharmawan 40 Reputation points
2023-11-25T09:59:56.3033333+00:00

Hi!
I am trying to develop application that must support authentication only using Microsoft login from multiple different tenants. Then, I am planning to use getSchedule from Graph API to get the schedule from each registered accounts (even with accounts from different tenants). Is this scenario possible to get implemented?

I also heard about publisher verification, is this also related or needed for scenario above?

Regards

Microsoft Security Microsoft Entra Microsoft Entra ID
Microsoft Security Microsoft Graph
{count} votes

Accepted answer
  1. CarlZhao-MSFT 46,371 Reputation points
    2023-11-27T07:52:41.9933333+00:00

    Hi @Yanitra Dharmawan

    Yes, this scenario can be implemented.

    If you want to have users from multiple different tenants log in to your app, then you must configure your app as a multi-tenant app.

    User's image

    When logging in, you will need to change /{tenant id} to /common to allow accounts from different tenants to log in.

    GET https://login.microsoftonline.com/common/oauth2/v2.0/authorize?
    client_id=xxxxxxxxx
    &response_type=code
    &redirect_uri=xxxxxxxxxx
    &response_mode=query
    &scope=Calendars.ReadWrite
    &state=12345
    

    Redeem the access token using the authorization code:

    POST https://login.microsoftonline.com/common/oauth2/v2.0/token
    Content-Type: application/x-www-form-urlencoded
    
    client_id=xxxxxxxxx
    &scope=Calendars.ReadWrite
    &code=OAAABAAAAiL9Kn2Z27UubvWFPbm0gLWQJVzCTE9UkP3pSx1aXxUjq3n8b2JRLk4OxVXr...
    &redirect_uri=xxxxxxxxx
    &grant_type=authorization_code
    &client_secret=xxxxxxxxxxx 
    

    Hope this helps.

    If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

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.