Closed thejaff2 closed 2 years ago
Hello!
I think I have encountered this error with one customer. The problem was some account mismatch/duplication. The user who granted the authorized the app, has signed in with an (wrong) account which did not have the permissions/license. Unfortunately, Fortnox does not detect that during the auth workflow, as of now, so it crashes later when trying to use the connector,
Anyway, it is just my guess. You should ask the customer to check his user permissions in the Fortnox portal. Also check what scopes are defined in the token (when you decode it), just to be sure there's nothing unexpected.
You are correct, in the auth-flow I was signing in with the wrong credentials/account, damn that browser auto-complete :)
I have created an Fortnox app and tested the customer connector with StaticCredentials, and it works. Now I have "upgraded" it to the Oauth authorization flow successfully, everything works fine with the user granting access to scopes (in this case, customer and invoice) and redirecting back to my web app (where I store access and refresh tokens in memory). But when trying to use the customer connector now (passing the accessToken wrapped in StandardAuth), I get the following FortnoxApiException: (exception message in Swedish, but translated in the issue title)
(I have tried both with and without using "service account" in both portal and code.)