XF 2.3 API returning 401 / unauthorized error after migration

nero

Member
Hello,

I have an issue with one of the boards I'm managing after migrating to 2.3.

The board is very basic and the only add-on installed is XFI and it has been upgraded too.

Upgrade has been completed and there are no outdated templates.

I'm using the threads API to create a thread in a specific section of the board, impersonating a specific user. Nothing on the API caller side has changed before/after migration. API use was still working a few hours before migration.

Now, any call to the API returns the following:

Code:
{
    "errors": [
        {
            "code": "unauthorized",
            "message": "api_error.unauthorized",
            "params": []
        }
    ]
}

I'm calling the API with PHP's CURL and the only noticeable thing is that my board is private and is htaccess protected so I pass an extra header with the login/pass. This seems to be working since I see the call to /api/threads in the server logs and if not I wouldn't see this Xenforo's error.
This was already the case before migration and it was working perfectly fine.

I searched the documentation and did not find any changes regarding the API. Am I missing something?
 
Last edited:
I found the issue and fixed it.

Since I was using a login/password via htaccess to protect the board, I was passing the credentials using the HTTP_AUTHORIZATION header which is now used by the new oAuth identification system.

I authorized calls to the specific endpoints I'm using without need of the extra HTTP_AUTHORIZATION header.
 
Back
Top Bottom