service.staticpath breaks oauth flow; returns 404 Not Found #1531

Closed
opened 2023-05-25 07:18:19 +00:00 by edward-shen · 3 comments

Description

Users attempting to set up Oauth flow while serving the frontend via the service.staticpath key set will result in the callback to vikunja always returning 404.

Steps to repro:

  • Set service.staticpath to a folder containing any frontend (tested 0.20.5)
  • Initialize an OpenId provider of your choice in addition to setting up Vikunja as well to use it.
  • Use the following nginx location block:
location / {
    proxy_pass http://10.0.0.214:3456;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $remote_addr;
    client_max_body_size 20M;
}
  • Attempt to sign in via oauth, you will be redirected back to the Vikunja instance, but it will return a 404.

This could be a misunderstanding of what the key does, but I had assumed the idea to allow for easy bundling of the front and backend.

There is a usable workaround: Follow the nginx reverse proxy.

Just trying to get this out in case other folks run into this issue.

Vikunja Frontend Version

0.20.5

Vikunja API Version

0.20.4

Browser and version

n/a

Can you reproduce the bug on the Vikunja demo site?

No

Screenshots

No response

### Description Users attempting to set up Oauth flow while serving the frontend via the `service.staticpath` key set will result in the callback to vikunja always returning 404. Steps to repro: - Set `service.staticpath` to a folder containing any frontend (tested 0.20.5) - Initialize an OpenId provider of your choice in addition to setting up Vikunja as well to use it. - Use the following `nginx` `location` block: ``` location / { proxy_pass http://10.0.0.214:3456; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $remote_addr; client_max_body_size 20M; } ``` - Attempt to sign in via oauth, you will be redirected back to the Vikunja instance, but it will return a 404. This could be a misunderstanding of what the key does, but I had assumed the idea to allow for easy bundling of the front and backend. There is a usable workaround: Follow the nginx reverse proxy. Just trying to get this out in case other folks run into this issue. ### Vikunja Frontend Version 0.20.5 ### Vikunja API Version 0.20.4 ### Browser and version n/a ### Can you reproduce the bug on the Vikunja demo site? No ### Screenshots _No response_
edward-shen added the
kind/bug
label 2023-05-25 07:18:19 +00:00
Owner

Does Vikunja return the 404 or nginx?

Does Vikunja return the 404 or nginx?
Author

Vikunja. It was late last night, but this also repros without nginx at all.

The error code is almost certainly a go error; it's a json response with Go capitalization.

Vikunja. It was late last night, but this also repros without nginx at all. The error code is almost certainly a go error; it's a json response with Go capitalization.
Owner

Should be resolved with b56e45d743 - please check with the next unstable build.

Should be resolved with https://kolaente.dev/vikunja/api/commit/b56e45d74389d38c747887d3cb2a2b295bb549c7 - please check with the next unstable build.
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: vikunja/vikunja#1531
No description provided.