Back to all reviewers

Use proper authentication

appwrite/appwrite
Based on 1 comments
Markdown

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.

Security Markdown

Reviewer Prompt

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.

1
Comments Analyzed
Markdown
Primary Language
Security
Category

Source Discussions