nilsteampassnet / TeamPass

Collaborative Passwords Manager
https://www.teampass.net
1.63k stars 532 forks source link

403 Access Forbidden by CSRFProtector #4148

Open shanima333 opened 2 months ago

shanima333 commented 2 months ago

Teampass version: 3.1.2.29 PHP version: 8.2.7

I'm encountering a "403 Access Forbidden by CSRFProtector!" error while attempting to authorize the API. Below is the content of my csrfp.config.php file.

`<?php /**

return array( "CSRFP_TOKEN" => "7e*637**ed10876f3", "logDirectory" => "../log", "failedAuthAction" => array( "GET" => 0, "POST" => 0), "errorRedirectionPage" => "", "customErrorMessage" => "", "jsPath" => "../js/csrfprotector.js", "jsUrl" => "http://teampass.domain.local/includes/libraries/csrfp/js/csrfprotector.js", "tokenLength" => 50, "cookieConfig" => array( "expire" => '', "path" => '', "domain" => '', "secure" => true, "httponly" => true, "samesite" => "Lax", // None || Lax || Strict ), "disabledJavascriptMessage" => "This site attempts to protect users against <a href=\"https://www.owasp.org/index.php/Cross-Site_Request_Forgery_%28CSRF%29\"> Cross-Site Request Forgeries attacks. In order to do so, you must have JavaScript enabled in your web browser otherwise this site will fail to work correctly for you. See details of your web browser for how to enable JavaScript.", "verifyGetFor" => array("type=duo_check", "upload.attachments.php", "upload.files.php", "type=ga_generate_qr") );`

I'm using the following command to authorize the API:

`curl -L -X POST \

http://teampass.domain.local/api/index.php/authorize \ -H 'Content-Type: application/json' \ -d '{ "apikey": "K***x", "login": "test", "password": "8zY**" }'

docker-compose.yaml

`version: "3" services: nginx: image: jwilder/nginx-proxy:alpine container_name: tp_nginx restart: unless-stopped networks:

networks: frontend: backend: external: true teampass-internal:`

justin77x commented 2 months ago

did yousolved that