Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


  • 0

http authentication for virtual devices.


nmnetmedia

Question

Hello,

I can send http request to my external device using :

GET /web/remotecontrol?command=116 HTTP/1.10x0D0x0A0x0D0x0A

works nice, but now I protected my device with password & username (basic http .htaccess)

Anyone has an idea how I can send my username & password ?

Many thanks,

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0
Guest GG

Try this

GET /web/remotecontrol?command=116 HTTP/1.10x0d0x0a

Authorization: Basic dGVzdDp0ZXN00x0d0x0a0x0d0x0a

where authorization code is : base64 encoded

Link to comment
Share on other sites

  • 0
  • Inquirer
  • Try this

    GET /web/remotecontrol?command=116 HTTP/1.10x0d0x0a

    Authorization: Basic dGVzdDp0ZXN00x0d0x0a0x0d0x0a

    where authorization code is : base64 encoded

    Hi, thanks for the feedback, not sure if I'm doing this the right way because it's not yet working..

    Asuming login info would be admin:1234

    Then i need to use:

    GET /web/remotecontrol?command=116 HTTP/1.10x0d0x0a

    Authorization: Basic YWRtaW46MTIzNA==0x0d0x0a0x0d0x0a

    right ?

    Many Thanks,

    Link to comment
    Share on other sites

    • 0
    Guest GG
    Hi, thanks for the feedback, not sure if I'm doing this the right way because it's not yet working..

    Asuming login info would be admin:1234

    Then i need to use:

    GET /web/remotecontrol?command=116 HTTP/1.10x0d0x0a

    Authorization: Basic YWRtaW46MTIzNA==0x0d0x0a0x0d0x0a

    right ?

    Many Thanks,

    It might be that you need to put the whole string on a single line, otherwise an extra LF is inserted.

    I have defined a virtual device like attached image and it seem to send the correct data.

    What I experianced was that if I delete all buttons in a virtual device and then add a new button, the new button seem not to work. Instead I deleted the virtual device and created a new one, then it worked for me.

    Please login or register to see this attachment.

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Many thanks for your help & time GG.

    Not sure why but can't get this working, might be a limitation from my device, not sure

    I did some tests with multiple http command lines and this seems to work.

    Sample:

    GET /web/remotecontrol?command=139 (call Menu)

    HTTP/1.10x0D0x0A0x0D0x0A GET /web/remotecontrol?command=108 (navigate down)

    HTTP/1.10x0D0x0A0x0D0x0A GET /web/remotecontrol?command=108 (navigate down)

    HTTP/1.10x0D0x0A0x0D0x0A GET /web/remotecontrol?command=352 (start mediaplayer)

    HTTP/1.10x0D0x0A0x0D0x0A GET /web/remotecontrol?command=401 (load/play playlist)

    HTTP/1.10x0D0x0A0x0D0x0A

    Pretty cool actually, it can display custom text messages on your TV screen, play your favority song when activating scene, pauze current channel and zap to IPCAM..

    Please login or register to see this link.

    Link to comment
    Share on other sites

    • 0
    Guest GrZeCh

    Hello,

    in my opinion you should use LUA. Check this fibaro doc (Net.FHttp):

    Please login or register to see this link.

    Of course you didn't mentioned which HC2 version you are using so it might be solution not yet for you.

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Hello,

    Of course you didn't mentioned which HC2 version you are using so it might be solution not yet for you.

    Thanks for the info, I'm using 1.044 (beta firmware 3.x does not work on my box, unable to login after update admin/admin didn't worked and unable to reset password). Got over 100 nodes connected to my fibaro so not sure what causes the update problem.

    So i guess I'll need ot wait for stable release.

    Please login or register to see this image.

    /emoticons/default_sad.png" alt=":(" srcset="https://forum.fibaro.com/uploads/emoticons/[email protected] 2x" width="20" height="20" />

    Link to comment
    Share on other sites

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Answer this question...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

    ×
    ×
    • Create New...