observatorycontrolsystem / ocs_example

An example OCS project
GNU General Public License v3.0
5 stars 2 forks source link

Issue logging into observation portal in OCS example #13

Open jmccormac01 opened 2 years ago

jmccormac01 commented 2 years ago

Hi, First of all, thanks a lot for making this code available. It looks incredible. I've been working through the documentation on the ocs_example and have downloaded the example project. I've used docker-compose to spin up the system and I'm able to log into all the admin interfaces and query the API endpoints. However, I am unable to log into the Observation Portal with the test user credentials.

I'm using the code in this repo (9300be1 commit).

Docker version

▶ docker -v
Docker version 20.10.14, build a224086

Docker compose version

docker-compose version 1.29.2, build 5becea4c

When I try logging in with the test credentials I see the following in the docker logs and nothing happens. I've tried in Safari (Version 15.4 (17613.1.17.1.13)), Firefox (Version 101.0.1) and Chrome (Version 102.0.5005.115) and get the same thing.

observation-portal_1       | Forbidden (CSRF cookie not set.): /accounts/login/

observation-portal_1       | 2022-06-13 22:50:38.176  WARNING:             log: Forbidden (CSRF cookie not set.): /accounts/login/

observation-portal_1       | 2022-06-13 22:50:38.176  WARNING:      middleware: PortalRequestLog | {"ip_address": "172.19.0.1", "uri": "/accounts/login/", "status": 403, "method": "POST", "user": "anonymous", "simple_interface": false}

observation-portal_1       | [13/Jun/2022 22:50:38] "POST /accounts/login/?passthrough=true HTTP/1.1" 403 1416

Any help figuring this out would be great, thanks.

jmccormac01 commented 2 years ago

This morning I tried logging into the observation portal using the URL http://127.0.0.1:8080/accounts/login using the test user credentials and it worked! I logged out and tried again using http://localhost:8080/accounts/login and it stopped working again. It seems I have to use the 127.0.0.1 URL for it to work, but I have a work around for now. Thanks.