Search code examples
intuit-partner-platformquickbooks-online

InitializeServiceContext in Initializer.cs has started throwing "Unauthorized" in my test app


Using the c# devkit against qbo. When i left yesterday everything was working, however today attempting to initialze the servicecontext in my test application I started getting the "Intuit.Ipp.Exception.InvalidTokenException: Unauthorized" error.

ServiceContext context = Initializer.InitializeServiceContext(oauthValidator, realmId, string.Empty, string.Empty, dataSourcetype);

and the error is here in the InitializeServiceContext: context = new ServiceContext(oauthValidator, realmId, intuitServiceType);

I registered my test company yesterday (i.e. I now have a paid quickbooks online account) am i not allowed to continue testing against a real account? Or have i made a bigger error somewhere.

Thanks

Edit:

When trying to log into my test app on the Intuit Developer Playground I'm getting the following error:

Oops! An error has occurred.

Please close this window and try again.

Error Code: internal_error
Message: Error Authorizing Request Token: <redacted-token>

Solution

  • Your OAuth tokens are no longer valid. Initializing the ServiceContext object for QBO retrieves the base URL for the realm, which requires authorization and is throwing the unauthorized error as a result.