iBuzzes
(Ryry)
February 23, 2022, 12:20am
#1
Hi, I’m trying to get the X-CSRF-TOKEN but I’m getting the following error: Header “Cookie” has unallowed character “|” in value
How could I fix this problem?
local module = {}
local options = {}
local HttpService = game:GetService("HttpService")
function module.getToken(Cookie)
local response = HttpService:RequestAsync({
Url = "https://auth.roproxy.com/v2/logout",
Method = "POST",
Headers = {
["Cookie"] = Cookie
}
})
if response.Success and response.Body then
return HttpService:JSONDecode(response.Body)
end
end
return module
Forummer
(Forummer)
February 23, 2022, 1:49am
#2
Escape it by prefacing it with a backslash, i.e; \|
.
1 Like
iBuzzes
(Ryry)
February 23, 2022, 2:10am
#3
Hi, that fixed the error but now it throws another error:
{"errors":[{"code":0,"message":"Authorization has been denied for this request."}]}
Forummer
(Forummer)
February 23, 2022, 2:17am
#4
You’ll need to use your cookie & X-CSRF token.
1 Like
iBuzzes
(Ryry)
February 23, 2022, 2:21am
#5
How do I get the X-CSRF token?
Forummer
(Forummer)
February 23, 2022, 2:40am
#6
I used the https://api.roblox.com/sign-out/v1 endpoint to get the x-csrf token from roblox, this worked fine until recently I’ve noticed this endpoint does not work anymore and would return a 404, this caused my group bot to stop working.
So I’m wondering if there is another way to get the token?
Sorry if this is not the right place for this.
(python)
I used to retrieve the token by sending an api and getting getting the key “x-csrf-token” in the header…
however I found out that since 3-4 days ago, it gave me a keyerror when trying to get the token. So I decided to print the header and this is what I got
{'cache-control', 'content-type': 'application/json; charset=utf-8', 'server': 'Microsoft-IIS/8.5', 'x-aspnetmvc-version':, 'x-frame-options':', 'access-control-allow-credentials': , 'x-aspnet-version':, 'x-powered-by':, 'p3p':, '…
Before anyone says this question has been asked hundreds of times before, I know. I’ve checked every single post and none of them have helped my achieve what I wanted. Mostly because everyone is using Python and not JS and Node.
Simply, all I want to do is fetch the X-CSRF token. This is the code that does the job.
function getToken(){
http.request({
host: 'auth.roblox.com',
path: '/v1/logout',
method: 'POST',
headers: {
'Cookie': `.ROBLOSECURIT…
Various Roblox pages include it in their request headers too.
1 Like
sorry for the bump but where would I put this?