Keep getting permission denied or unauthorized request

77 Views Asked by At

I using Appgamekit studio with the built in http commands. With these commands i was able to signup users and login, with open rules i cconnect to the database to post and read. Once i added rules. it keeps telling permission denied or unauthorized request. I havent got any confirmation emails ethier so i wonder it its n even confirmed? But imso having trouble sending the verification email. Everything im g im using http request from in app

{
  "rules": {
    "$uid":{
      ".read":"$uid === auth.uid",
      ".write":"$uid === auth.uid"
    }
  }
}

sample code:

function senddatabase()
local result$ as string
local idtoken as string
IHTTP = CreateHTTPConnection()
SetHTTPHost(IHTTP, realtdata, 1)//realtdata = next-species-29059882-default-rtdb.firebaseio.com
AddHTTPHeader( iHTTP,'Content-Type: application/json','set')
//send file to database
useridtoken.idToken = userdata.localid
//useridtoken.idToken = userdata.idToken
result$ = 
SendHTTPRequest(IHTTP,'data.json?auth='+userdata.uid,userdata.tojson())
while GetHTTPResponseReady( iHTTP ) = 0
print("connecting.....")
endwhile
response$ = GetHTTPResponse( iHTTP )
statuscode = GetHTTPStatusCode( iHTTP )
CloseHTTPConnection( iHTTP )
rawdata = result$
endfunction result$

Tried many variations of adding different headers and different uid and idtokens with no luck. Im very new to using the rest methods and also using them in appgamekit studio.

ive used posman with this ul and it still doesnt work https://next-species-29059882-default-rtdb.firebaseio.com/data.json?auth=s4hmxQDqFNbDPd13ioxaYzKJUbn1

0

There are 0 best solutions below