RetroShare / RSNewWebUI

30 stars 20 forks source link

Can't login #45

Closed electronstudio closed 1 year ago

electronstudio commented 3 years ago

I followed instructions in README. I'm using RetroShare 0.6.6.

When I open the webui/index.html page, before I do anything, RetroShare immediately prints:

W 1622922469.917 JsonApiServer authentication handler blocked an attempt to call JSON API authenticated method: /rsEvents/registerEventsHandler user: webui error: 2006 Wrong API password category: RetroShare JSON API

In RetroShare GUI JSON settings I had previously added the token webui:foo. So I enter username as webui and password as foo. I click login.

RetroShare then prints:

W 1622922656.813

The web browser displays in red text:

Retroshare-jsonapi not available.
Please fix host and/or port
rottencandy commented 3 years ago

Have you set the correct port?

Can you please check if you can curl the API directly?

curl --verbose -u webui:foo -H "Content-Type: application/json" http://127.0.0.1:9092/rsPeers/GetRetroshareInvite
electronstudio commented 3 years ago

Yes I think I can curl API directly:


*   Trying 127.0.0.1:9092...
* Connected to 127.0.0.1 (127.0.0.1) port 9092 (#0)
* Server auth using Basic with user 'webui'
> GET /rsPeers/GetRetroshareInvite HTTP/1.1
> Host: 127.0.0.1:9092
> Authorization: Basic d2VidWk6Zm9vYm9v
> User-Agent: curl/7.74.0
> Accept: */*
> Content-Type: application/json
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Access-Control-Allow-Headers: Authorization,DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range
< Access-Control-Allow-Methods: GET, POST, OPTIONS
< Access-Control-Allow-Origin: *
< Access-Control-Expose-Headers: Content-Length,Content-Range
< Connection: close
< Content-Length: 930
< Content-Type: application/json
<
{
    "retval": "CQEGAcGYxsBNBGC7zRQBCADwaY1SKlQA/yG/xTK/Fh+5bYxZgv5x3OMAvaCLndIE\nD084pHYJrD91UTisu8lIYc+cGVH8dOwdTXn2LO+X50l29W5L7L+MLaqlzmIY56Uy\nftxqEFw36f9/VUylg2cyqSfB8u1CqwhCyrjA2RsbCshKXaD0KMrDNqyvTBNuy1Qc\nFUbFYUq1e7T3N2w9Km906KUi9jKvuOi6AB3KKmS95tW9wxGM1BbtAv/3W8orHruD\nhvhhWkk9b0sNAImH02LZrVjORYxv24uzVhc5w1neaDfzp2Db5w7roSx1GcDbiIpf\nhb1bpJGtSHZdFpcWErzSsJEb0LEXstb1DktNo+q4BzjFABEBAAHNJHJpY2hhcmQg\nKEdlbmVyYXRlZCBieSBSZXRyb1NoYXJlKSA8PsLAXwQTAQIAEwUCYLvNFAkQG47p\nudUKx4ACGQEAAIHUB/407u4DjP/0DhbUsKCPrX0o3Xh99fgDJ8enRmMC03WYFW0x\nxbHq/qm5q8PG5E774qRBEnrMSg7mAOMILxEG8C6EVqlghGSS96euKI+XmCTgYOhg\nWgyJXvzK2SNS8N9IRHHjJCUYJGSY52jCsy2hMDnJBGlaUy1nJAiVWDYPQAyatZj8\nO8WdqTnGmYI0VgiEd961Zjq5LyCNRMYcecQ/Cj0CcoyGQKURxuOQl8wOYlYZy9+7\nI8wegbtF3HdSPO3vT7h1zgSgJysJKAK009nXxRS5uykAD7heWpVPIUqAB2UPARxH\nl1FPZMuKTvgasbnMRJ3NCqbWK0aNJGf0ld4QmmfIAgbBitri5ZMDBsCoAQXlkwQA\nBg1PZmZpY2UgRGViaWFuBRCnEs1XFavS8umfKoehnYcDBwOFzXg="
* Closing connection 0
* ```
electronstudio commented 3 years ago

I know nothing about debugging Javascript but I loaded the console in Firefox and it showed this, which may be the problem?

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://127.0.0.1:9092/rsEvents/registerEventsHandler. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).
rottencandy commented 3 years ago

Ah right, this was recently fixed in RS: https://github.com/RetroShare/RetroShare/pull/2386 Perhaps your build does not have the fix yet.

If possible, you could try with a more recent build.

defnax commented 1 year ago

@csoler @rottencandy close this topic