KoenZomers / OneDriveAPI

API in .NET Framework 4.8.0, .NET Core 3.1 and .NET 6.0 to communicate with OneDrive Personal and OneDrive for Business
Eclipse Public License 1.0
109 stars 34 forks source link

101 The app ID is blocked for access of the O365 Discovery Service #13

Closed xabier98 closed 5 years ago

xabier98 commented 6 years ago

We are getting this error calling discovery service

{"error":{"code":"101, Microsoft.Online.Services.O365Discovery.O365DiscoveryException","message":"The app ID is blocked for access of the O365 Discovery Service."}}

With no service found we get an object not set ....

KoenZomers commented 6 years ago

Can you try this again with the current latest version? The ClientSecrets had expired and I renewed them a few days ago. It's a best practice to generate your own Client ID / Client Secret when starting to use this library in your own projects so you're not dependent on my registration.

xabier98 commented 5 years ago

We are using our own ClientID / Client Secret, We have created it on azure´s portal.

We use the library in a windows service, periodically we upload new files to users paired.

I think our credentials have been banned due to the use of a not refreshed token (we only try to refresh the token when there is somethig to sincronize for this user, if for a while there is nothing to sincronize we are not able to refresh the token, the service have been calling one and again with a wrong, now we try to get a new token each day so we allways can refresh it). This is just a suspicion.

What do you mean with ClientSecrets had expired?

KoenZomers commented 5 years ago

The ClientSecret you generate expires by default after, I believe, 1 year. But then it would never work anymore using this client id/client secret combination. If it still works if you do a new interactive authentication, then that's not the issue.

The discovery exception leads me to believe you're using the OneDriveForBusiness API, is that correct? Have you tried using the Graph API instead? It's the recommended approach anyway.

KoenZomers commented 5 years ago

Closing due to no further feedback being received.