Back

Overriding cloud provider requirement

  • 0
  • Databases
  • Self Hosted
  • Cloud
sourabpramanik
15 Feb, 2024, 14:14

I am trying to build the Appwrite adapter for NextAuth.js which provides an easy setup to add authentication to NextJS, Svelte, etc. using different providers and adapters. The adapter connects the database with the front end and you don't have to write any query to create, update, delete, and read any user, session, or token. Adapters have methods defined to query the database.

I created the adapter and tested it locally in isolation and in integration with NextJS, everything worked as expected now I had to write the script which can create a database, create all the collections with attributes and indexes, and create relationships. So far so good but I got stuck at one point, in the test we cannot use credentials to create a project or use an existing project because it will be tested by many different members at NextAuth and they do not want to create an account and project just for testing this adapter. So they said, "We need a way to test it locally without any cloud provider requirement, like Firebase local emulator". As far as I know, even for using self-hosted Appwrite I will need to log in to create a project. Now is there any way we can override authentication? or any alternative

I hope my problem is clear, if not then please let me know. Thanks

TL;DR
Title: Overriding Appwrite authentication for local testing Messages: The developer is seeking a way to test their Appwrite adapter for NextAuth.js locally without the need for authentication. They want to avoid relying on a cloud provider like Firebase. The user suggests the workaround of exposing the mariadb port and running a query to create a token with the necessary permissions. The developer also asks if it's possible to set the project ID in the compose file. No solution is provided in the thread. Solution: Unfortunately, no solution is provided in the support thread.
sourabpramanik
15 Feb, 2024, 14:16
D5
15 Feb, 2024, 14:22

Replied there

Guille
15 Feb, 2024, 14:23

You mean like for example, to create the database, collection, etc you use the server SDK, you don't even want to use the token? Because if you use a token, and then give all permission to the collection you won't need authentication.

In your case, you want to avoid any authentication? (I don't know Fibrebase local emulator)

sourabpramanik
15 Feb, 2024, 14:24

Read that but still, you need to log into the console running on your local to create a project.

sourabpramanik
15 Feb, 2024, 14:28

We do need the token otherwise nothing works right. A kind of proxy I don't know πŸ˜… . A way that can let me use all the methods locally and since it is local maybe we can remove authentication to the console, right?

Guille
15 Feb, 2024, 14:32

Just to understand, the appwrite instance will be run locally right? or do you pretend to integrate someting similar to CI/automation?

sourabpramanik
15 Feb, 2024, 14:37

Yes it will run locally.

sourabpramanik
15 Feb, 2024, 14:38

Is there a way I can set the project ID in the compose file?

D5
15 Feb, 2024, 14:40

What do you want to?

D5
15 Feb, 2024, 14:41

It's like trying to test a MariaDB database without installing it πŸ€·β€β™‚οΈ

Guille
15 Feb, 2024, 14:42

Not really, the only workaround I can think at this moment, is to expose the mariadb port and run a query, to create a token with the permissions so you can always use the same token, and it will have the permission you need to create the database and all the stuff you need

sourabpramanik
15 Feb, 2024, 14:47

Apologise if my question was not clear. I know this is not how Appwrite works. I was hoping maybe we can just create a project locally without having to log in like we can do in supabase https://supabase.com/docs/guides/cli/getting-started?platform=linux anyways thanks for the help. I will try to figure a way out.

sourabpramanik
15 Feb, 2024, 14:47

That might be helpful thanks

Guille
15 Feb, 2024, 14:49

You're welcome, let me know if you get to work this, I think I understand why you need this

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more