Supabase authentication or connection #15266
Unanswered
LautaroZanzot
asked this question in
ESP8266
Replies: 1 comment
-
Have you tested accessing your db from regular cpython? I suspect this is not a micropython problem. The returned (very helpful) message indicates you need to set the "apikey" header: headers = {
"Content-Type": "application/json",
"apikey": API_KEY,
"Authorization": "Bearer " + API_KEY
} I dont know how your supabase auth works, it may be that you have to use the apikey to access the instance, but you may then have to authenticate a user session and access_token before inserting data. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am doing a project with the esp8266 module, and the data has to be sent to a db in this case it is supabase, but when I make the post with urequest it gives the error 401
`def send_data(tempC, defrost, contrl, bateria):
`
all the prints are
Error 401: Unauthorized https://...supabase.com/signals {'Authorization': 'Bearer eyJh...3gc', 'Content-Type': 'application/json'} {"temp": "[]", "defrost": "0", "bateria": "0", "idvigia": "1", "arranque_comp": "0"} Reason: b'Unauthorized' Text: {"message":"No API key found in request","hint":"No
apikeyrequest header or url param was found."}
Beta Was this translation helpful? Give feedback.
All reactions