Python | https://apis.roblox.com/challenge/v1/continue returning 404 - an internal error occurred

I’m trying to make a python script using “https://apis.roblox.com/reauthentication-service/v1/token/generate” to authorize my account but I keep getting a 403 error “Challenge failed to authorize request.”

I read this post and it says at the bottom to make a request to “https://apis.roblox.com/challenge/v1/continue” and I tried updating my python script to do that. The problem is, every time I try to make a request to /v1/continue, it always ends up resulting in a 404 error no matter what cookies, headers or json I put into my post request.

import requests

continuePOST = requests.post("https://apis.roblox.com/challenge/v1/continue")
print(continuePOST.text)

Doing this returns this
{"statusCode":404,"statusText":"Not Found","errors":[{"code":1,"message":"an internal error occurred"}]}

I have tried adding headers, with and without the CSRF token, and it still gives me the 404 error. I’ve tried adding my .ROBLOSECURITY cookie into the cookies in the post request and it still gives the 404 error. I’ve also tried adding the .ROBLOSECURITY cookie into the headers too and again it still ends up with a 404 error.

def getCSRFToken():
    csrfPOST = requests.post("https://auth.roblox.com/v2/logout", cookies=cookies)
    return csrfPOST.headers["x-csrf-token"]

headers = {
    'accept': 'application/json, text/plain, */*',
    'origin': 'https://www.roblox.com',
    "authority": "apis.roblox.com",
    'x-csrf-token': getCSRFToken(),
}

Even with this JSON being added to the post request, it still returns the 404 error.

def getAuthTokenID(pw):
    json_data = {
        'password': pw,
    }
    
    response = requests.post('https://apis.roblox.com/reauthentication-service/v1/token/generate', cookies=cookies, headers=headers, json=json_data)
    return response.json()["token"]

authID = getAuthTokenID("password here")

continueJSON = {
    'challengeId': authID,
    'challengeMetadata': f'{{\"reauthenticationToken\":\"{authID}\"}}',
    'challengeType': 'reauthentication',
}

continuePOST = requests.post("https://apis.roblox.com/challenge/v1/continue", headers=headers, json=continueJSON)

I have also tried going into the network tab in inspect element and copying the continue request as fetch and pasting it into the console, which also returns error 404, but yet it works when I’m not the one trying to authorize my account, only when roblox does it.

Does anybody have any idea on how to fix this?

i will check this out later when i can, be patient.

Finally found a fix for this.

I’ve been passing authID from “https://apis.roblox.com/reauthentication-service/v1/token/generate” as the challengeId the entire time and that’s why it would return error 404. When you send a request to “https://apis.roblox.com/challenge/v1/continue”, make sure to send the challengeId, which you can get from the headers of the api you want to use, when it returns error 403.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.