Always implement the correct authentication method for API clients as specified in the SDK documentation. Incorrect authentication methods can lead to security vulnerabilities, API access failures, or unintended behavior.
Always implement the correct authentication method for API clients as specified in the SDK documentation. Incorrect authentication methods can lead to security vulnerabilities, API access failures, or unintended behavior.
Incorrect example:
Client client = new Client()
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1")
.setProject("<YOUR_PROJECT_ID>")
.setSession(""); // INCORRECT: Empty session token
Correct examples:
// For API key authentication (server-side)
Client client = new Client()
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1")
.setProject("<YOUR_PROJECT_ID>")
.setKey("<YOUR_API_KEY>");
// For JWT authentication
Client client = new Client()
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1")
.setProject("<YOUR_PROJECT_ID>")
.setJWT("<YOUR_JWT>");
Using the proper authentication method ensures your application interacts securely with external services and prevents unauthorized access.
Enter the URL of a public GitHub repository