So currently i’m using roproxy to access roblox api endpoints. It’s fine for endpoints that don’t require authentication at all, but for API endpoints that require cookies. Roproxy doesn’t work.
For example, I was testing this endpoint for one of my old games just to play around with httpservice:
As you can see if you go on the URL: “Authentication cookie is empty”. However, if I replace the domain of roproxy.com with roblox.com it immediately grants me all the information I want. Only problem is httpservice obviously can’t access this endpoint directly through the roblox domain.
In the script, i’ll get a status code of 401 and the error message in the response body says “User is not authenticated”. However, this is literally my own game. And I’ve put my cookie in the cookie header. So my only idea is that this is a problem with roproxy possibly, maybe roproxy doesnt have support for cookies? I’m not sure. I used inspect element on the roproxy domain for my endpoint and I saw there is no cookie request header like there is in the roblox domain. So my only solution would be to self host my own proxy. Or is there something im doing wrong?
Are you sure? The error I get in httpservice just says “User isn’t authenticated”. If the cookie header was stripped wouldn’t it say “Cookie header is empty” like it says on the browser?
I thought this might be due to the way I’m getting my roblox cookie. What I do is I go into inspect element, then I go to network. I find any URL endpoint and grab the request header cookie information. Then I remove the unallowed characters manually by pasting the cookie info onto a website and removing with the find developer tool feature on google.
‘User isn’t authenticated’ is just the standard error the api returns when it doesn’t find a cookie. the api receives an anonymous request and throws that 401 error.
this method is pretty tedious. just go to the Application tab in dev tools → Cookies and copy the .ROBLOSECURITY value directly. but either way, it won’t work on roproxy.
Yep that works. since you’re hosting it yourself, it won’t strip the headers unless the code explicitly tells it to
just a heads up: if you use that proxy for auth requests, make sure you add a secret key check (like a password header) in the worker script. otherwise anyone who finds your url can use your proxy and eat up your request quota
I’m not too strong with web development I honestly just learnt some of the stuff needed in web development to use HTTPService. So I have a few questions.
Cloudflare lets you create your own domain right? So by default all HTTP headers are accepted by the domains? And once i’ve created my domain do I just replace roblox.com with my URL?
Then I would just replace the roblox domain with my domain like so?
cloudflare gives you a free subdomain ending in .workers.dev.
yeah headers are accepted, but the script code needs to actually forward them. that template you linked probably handles it tho.
you don’t put apis. in front of your worker domain. you replace the whole base url.
so https://apis.roblox.com/cloud/v2/groups/{group_id} becomes https://your-project.subdomain.workers.dev/cloud/v2/groups/{group_id}
Oh? Well I thought that’s what you had to do becaues that’s how you have to handle it with roproxy. You just replace anything that says roblox.com with roproxy.com and you keep everything else including apis.
Alright and one more thing, the guy who owns that template will he have access to my cookies/api keys since i’m doing stuff through his template? Or do I have full control over that?