question

jaredgibb-8807 avatar image
0 Votes"
jaredgibb-8807 asked saldana-msft edited

How can I add an organization to tenant guid ( error: OrganizationFromTenantGuidNotFound )

I am setting up microsoft graph auth and API calls for the firs time in a new app.

i can successfully authenticate a user, return access and refresh tokens, then make the first call to get my profile info.

I can even make this call as the app and not a 'user'.

where i am running into issues is making calls to get my calendar by adding /calendars to the end of my profile call. when I do this I get this error:

{ 
  "error": { 
    "code": "OrganizationFromTenantGuidNotFound", 
    "message": "The tenant for tenant guid    '1dd120fe-cbd9-492b-b36d-12e4aa856cf3' does not exist.", 
    "innerError ": { 
      "oAuthEventOperationId ": "    ae00f89a - 1 d34 - 4299 - af82 - 93 d5c0409ada ", 
      " oAuthEventcV ": "  mJu0K0YLfbqLxFewMqMcug .1 .1 ", 
      "errorUrl ": "https: //aka.ms/autherrors#error-InvalidTenant", 
      "requestId": "ae055090-cad5-4b0f-ad7b-9c0731c75bd4", 
      "date": "2021-09-15T16:18:10" 
    } 
  } 
}

as a note, I get the same error when making the call as either the user whose calendar I am requesting or as the application.

in the application I do have the permissions set like this
Permissions

and for reference, here is the URL I am calling that works

 https://graph.microsoft.com/v1.0/users/d4d0b2ef-6a3b-4254-b8bb-eb358194458b 

and the one that does not

 https://graph.microsoft.com/v1.0/users/d4d0b2ef-6a3b-4254-b8bb-eb358194458b/calendars 





here is a video of the issue


https://vimeo.com/605796641

microsoft-graph-calendarmicrosoft-graph-identity
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

ShwetaChoudhary-8869 avatar image
0 Votes"
ShwetaChoudhary-8869 answered

Thank you for reaching out.

It could be because Azure AD you created does not have Office 365. Thus it cannot have calendars. /users works because that is an Azure AD endpoint.

If you want to access calendars for your development O365 tenant, register the app in your O365 AAD tenant that you got when you created the development tenant

Follow the steps below -

  1. You need a Microsoft office 365 account with a subscription, can get this by applying for one on office 365 develop.

  2. Upon creating one, follow the instructions and add the apps to it.

  3. Go to Azure Portal and log in with your office 365 account.

  4. Create an app under AAD -> App registration

  5. Try to access https://graph.microsoft.com/v1.0/users/{user_id}/calendars.

Hope this helps.




5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.