-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to handle CSRF verification? #54
Comments
That's ... very strange. The paperless-ngx docs don't mention the requirement of CSRF token when using the API. What's your authentication method? If you're authenticating via user+password, does it work when switching to Token method? Also, can you provide (redacted) logs of the output and the exact CLI command/config? |
I'm experiencing the same issue. My
(I'm using just username + password for authentication.) I'm seeing this issue with paperless-ngx versions 2.3.3 and 2.4.0. Haven't tested others. |
I`m using 2.4.2 via the docker-compose setup. Based on this line, I woul expect the CSRF check to be disabled for the uplad endpoint: Can you tell us a bit about your setup @ccremer? |
I can't reproduce this. I've tried version 2.2 and 2.4. Both token method and username+password method work in my case. My Url is set to the publicly accessible one with a valid TLS cert. In my setup I'm using Let's Encrypt with Caddy as a proxy in front of it and have set the Maybe you could look closer into these options? |
The Are you also using the docker setup or the barematal installation? |
I found the problem... :D I had to remove the trailing This was what I have changed. - paperless-cli upload --token <token> --url https://<my-paperless-host>/ <my-file>
+ paperless-cli upload --token <token> --url https://<my-paperless-host> <my-file> So basically I send Thanks for your help! |
I guess this is also the same problem here, as there is also a trailing |
ah, well that wasn't obvious. But is stated in the docs for this Env var :)
I guess we could print out a warning if there's a trailing slash in the config though. |
Removing the trailing |
Summary
Not sure if this is a feature request or just something missconfigured on my server.
Basically I always get a CSRF verfification failed error, as I guess the CSRF token is missing in the request.
It would be very nice to get some advice about this, as I really like to use your client instead of writing something myself.
Context
The Error I got:
Out of Scope
Further links
Acceptance criteria
Implementation Ideas
The text was updated successfully, but these errors were encountered: