Loxone HTTP Request with Authorization
Hi there
Im Struggling here with a Http request for a Loxone miniserver.
The request trough theChrome browser is working fine.
Wiresharked the Chrome command and try to send it by amx.
SEND_STRING dvIP_1,"
'GET /dev/sps/io/VI6/Impuls HTTP/1.1',$0D,$0A,
'Host: 192.168.1.4',$0D,$0A,
'Connection: Keep-Alive',$0D,$0A,
'Authorization: Basic YWRtaW46YWRtaW4=',$0D,$0A,
'Upgrade-Insecure-Requests: 1',$0D,$0A,
'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98
Safari/537.36',$0D,$0A,
'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8',$0D,$0A,
'Accept-Encoding: gzip, deflate',$0D,$0A,
'Accept-Language: de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7,und;q=0.6',$0D,$0A,$0D,$0A
"
All im getting back is:
- HTTP/1.1 401 Unauthorized$D$A
WWW-Authenticate: Basic realm="dev/sps/io/VI6"$D$A
Access-Control-Allow-Credentials: true$D$A
Content-Type: text/html$D$A
Content-Length: 125$D$A
Connection: close$D$A$D$A
error<
Is there anything i have to do different with the Authorization ?
The Passcode is admin admin.
Thanks for your help.
Manuel
Comments
The highlighted data in this line: <Authorization: Basic YWRtaW46YWRtaW4=',$0D,$0A,> is likely to be found being provided by the device after a authentication challenge.
It will be unique for the session assigned.
There are a few threads around here with examples on authentication processes but Wiresharking the preceding transaction should give you a better idea as to whats involved.
Thanks, its working now.
Had a few other issues with the TCP Module and Network problems.