What is a Secret?

I’m trying to utilize the new Secrets class in roblox as a way to safely secure my admin’s but I can’t seem to figure how to get the url. As it throws “Invalid URL”.

--_G.AA__LL = "Admins"
local Successful, Critical = pcall(function()
	return HttpService:GetAsync(HttpService:GetSecret(_G.AA__LL))
end)

The name is “Admins”, while the “Secret” is a raw pastebin url.

2 Likes

Devforum is a lost cause, can I please get a human to help me out? Like what is a SecretService?

1 Like

That doesn’t exist


Secret is used with web apis. Essentially, if you need to have a private api key for a specific web request, you can create a new “secret” from your game’s configuration page and access it within a script.

I did try that.
Domain is https://pastebin.com
Secret is the pastebin code
Name is “Admins”
When I try to access the url it gives off a dictionary error and output just puts Url and Secret(Admins)

local HttpService = game:GetService("HttpService")

local PastbinUrl = "https://pastebin.com"

local FullUrl = HttpService:GetSecret("Admins"):AddPrefix(PastbinUrl)

print(HttpService:GetAsync(FullUrl))

Was there a problem with the code I have sent you?

It’s ai generated and doesn’t exist at all, what is a SecretService??

I was going to offer a separate solution, but I re-read the original announcement, and it seems to only be compatible with the Headers dictionary within HttpService:RequestAsync() at the current moment, so you’ll have to use that method instead

Well that sucks I don’t think you can really get a raw pastebin using headers.

I figured it out!

local HttpService = game:GetService("HttpService")

local TheSecretAmongstWorlds = HttpService:GetSecret("Admins"):AddPrefix("https://pastebin.com/")


local Request = HttpService:RequestAsync({
	Url = TheSecretAmongstWorlds,
	Method = "GET",
	Headers = {
		['Content-Type'] = 'application/json'
	}
})
2 Likes

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