Page 1 of 1
json authentication
Posted: Mon Nov 07, 2022 10:34 pm
by pajito
Hi there,
I am trying to populate a widget via an online json file. I managed to do so when I used an "open" online json file, the problem comes when the official data I have to use has an authentication key. There is also a basic authentication with username and password, which also I can not figure out, but I was instructed to use the authentication key.
Any ideas?
thanks in advance
pajito
Re: json authentication
Posted: Mon Nov 07, 2022 11:18 pm
by stam
Hi Pajito,
do you mean you're trying to log in with an online API that accepts and returns JSON?
I suspect you need to set the data in httpHeaders - if that's the case you should search the forum and the Dictionary for examples - there are a few in the forums.
If it's something else, can you clarify?
HTH
Stam
Re: json authentication
Posted: Mon Nov 07, 2022 11:27 pm
by pajito
Hi and thanks for the reply,
yes i tried this approach but it didn't return any results. propably I use it wrong or something
Re: json authentication
Posted: Tue Nov 08, 2022 12:32 am
by FourthWorld
pajito wrote: ↑Mon Nov 07, 2022 10:34 pm
the problem comes when the official data I have to use has an authentication key. There is also a basic authentication with username and password, which also I can not figure out, but I was instructed to use the authentication key.
What are the instructions for using the authentication key?
Re: json authentication
Posted: Tue Nov 08, 2022 12:50 am
by pajito
[/quote]
What are the instructions for using the authentication key?
[/quote]
hi, they just gave me a link which I can share
Code: Select all
https://www.myrace.gr/json/leaderboard?id=2146&m=5148
and an authentication key. There is a basic authentication mode but still doesn't seem to work
thanks
Re: json authentication
Posted: Tue Nov 08, 2022 3:12 am
by FourthWorld
Did they provide any instructions on what you're expected to do with the authentication key? Does it go in the headers? Does it become a URL parameter? Any instructions at all?
Re: json authentication
Posted: Tue Nov 08, 2022 7:22 am
by pajito
FourthWorld wrote: ↑Tue Nov 08, 2022 3:12 am
Did they provide any instructions on what you're expected to do with the authentication key? Does it go in the headers? Does it become a URL parameter? Any instructions at all?
Hi, yes the authentication goes to the headers. Bellow you can find the code I used with batch file and managed to data
Code: Select all
curl -H "authorization:abcdefgh" "https://www.myrace.gr/json/leaderboard?id=2146&m=5148"
Obviously the authentication key is not that,but I can share in a DM
Thank you
Re: json authentication
Posted: Tue Nov 08, 2022 9:32 am
by pajito
FourthWorld wrote: ↑Tue Nov 08, 2022 3:12 am
Did they provide any instructions on what you're expected to do with the authentication key? Does it go in the headers? Does it become a URL parameter? Any instructions at all?
Also I was given the option of basic authentication as the administrator called it , which has a username and a password
Re: json authentication
Posted: Fri Nov 11, 2022 2:45 am
by FourthWorld
Have you used Basic Auth before?