Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Authentication cookies not forwarded #260

Closed
FoliniC opened this issue Sep 28, 2023 · 5 comments
Closed

Authentication cookies not forwarded #260

FoliniC opened this issue Sep 28, 2023 · 5 comments

Comments

@FoliniC
Copy link

FoliniC commented Sep 28, 2023

Version of the custom_component

latest

Configuration

multiscrape:
  - resource: "http://192.168.0.1:1234/cgi-bin/reboot.sh?boot=now"
    scan_interval: 60000
    log_response: True
    button:
      - unique_id: reboot_router
        name: reboot router
    form_submit:
      submit_once: True
      resubmit_on_error: False
      resource: "http://192.168.0.1:1234/cgi-bin/get_password_cookie.sh"
      input:
        password: 'withChar&$#SG8Mb"^'
    sensor:
      - select: ""
        name: reboot_router```

## Describe the bug
From form_submit_response_body.txt I see the cookies are set correctly
Set-Cookie:hash=D678DFD98D668721F6E37F6F20E1EE9DDFF168FF382DF82E61E6E2F7DF189D68; Path=/;
Set-Cookie:exp=1692908272; Path=/;

in  page_request_headers.txt I would expect those cookies, but there's "None"
in page_response_body.txt I see the error that I'm not logged on.

I'm doing something wrong?
@jeremicmilan
Copy link
Contributor

Will #327 fix the problem?
If so looking forward to feedback. :)

@Joao-Sousa-71
Copy link

Will #327 fix the problem? If so looking forward to feedback. :)

Me too!

@rubinlinux
Copy link

I'm experiencing this too. I'm attempting to scape a mocreo hub using the configuration similar to here:
https://gist.github.com/sdrapha/a942171c3ff0ca16b3f74fab6a3e919a

With log_response enabled, I see the set-cookie header being returned from the form in form_submit_response_headers.txt Headers({'content-type': 'text/html; charset=UTF-8', 'set-cookie': 'id=b03494a0-68d8-f13a-c780-8892c20caa1c; Max-Age=86400;'})

but in page_request_headers.txt is only {}

I tried with 7.0.3 and also going back to 6.8 and this still seems to be the case

Does the login form not save cookies between requests? How could it ever have worked for anyone? What am I missing??

Thanks!

@jeremicmilan
Copy link
Contributor

Actually, I think #368 solves this issue.

@danieldotnl
Copy link
Owner

Please try release 7.1.2 and let me know if it addresses your issue!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants