But this error will not pop up in a live game, it will work totally fine.
Here’s how I’m getting the secret:
local Secret = HttpService:GetSecret("SecretName")
local s, e = pcall(function()
HttpService:PostAsync(URLHERE, HttpService:JSONEncode(SENDDATA), Enum.HttpContentType.ApplicationJson, false, {
["accept"] = "application/json",
["authorization"] = Secret ,
})
end)
if not s then warn(e) end
My Secrets in my game settings looks like this {"SecretName": ["SecretValueHere", "*.on.aws"]}
Most likely it’s happening due to SecretValueHere missing base64 encoding. It looks like documentation doesn’t make it clear that SecretValueHere should be base64 encoded. So, for example, if your secret value is “mySuperSecret”, the JSON should be this:
Secrets are not limited to (textual) API keys, and technically may contain binary values (e.g. ECDSA private key, or DER-encoded private key for mTLS). I didn’t expect this feature to be so popular, hence didn’t account for a proper UX. Otherwise, it should be turned into a 3-column table, with Add/Remove buttons.
To ensure I understand: are you running “Team Test”? This implies using production secret, the one submitted through Creator Hub (local secret isn’t used).
If you’re running it locally (F5 in Studio), then locally-defined secret is used. I tried your example, 9e755373-cf03-4b4a-8d50-a0f2cfdd7e1a, which resulted in this JSON:
It works perfectly fine for me. Would you mind providing an example of some base64 encoded secret value that triggers the error? Or, could you try decoding it (e.g. here: https://www.base64decode.org/ ) and check if it decodes to the original value?