Appwrite error: Inavlid Origin. Register your new client (<domain>) as a new Web platform on your project console

2k Views Asked by At

I'm using appwrite/install to install my appwrite instance. During the installation I enter localhost for host, 8004 for HTTP and 8005 for HTTPS and my domain for CNAME.

docker run -it --rm     
--volume /var/run/docker.sock:/var/run/docker.sock     
--volume "$(pwd)"/appwrite:/install/appwrite:rw     
-e version=0.6.2     
appwrite/install

All the containers start and run without any issues and I can access the login and signup pages of appwrite.

I also use a separate nginx instance to proxy all the requests of my domain to appwrite. I can also post this config in case this has to do with the issue.

When I create a new account I get the error message Registration Failed. Please try again later in the user interface and 403 Inavlid Origin. Register your new client (<domain>) as a new Web platform on your project console in the browser console.

Apparently appwrite did not apply the CNAME I entered at the installation. What am I doing wrong?

2

There are 2 best solutions below

1
On BEST ANSWER

403 error means Appwrite does not recognize this web client and protects you from a [CSRF][1] attack.

A few things, set _APP_DOMAIN and _APP_DOMAIN_TARGET both to your actual domain name and not localhost.

That should get you going without a proxy, with a proxy you should make sure it passes the host name to the Appwrite server.

Make sure to [pass the host header][2] when using nginx as a proxy:

proxy_set_header Host $host;

[1]: https://owasp.org/www-community/attacks/csrf#:~:text=Cross%2DSite%20Request%20Forgery%20(CSRF,which%20they're%20currently%20authenticated [2]: https://docs.nginx.com/nginx/admin-guide/web-server/reverse-proxy/#passing-request-headers

0
On

Another thing you can try is to add your domain name to the appwrite platform