
I tried the C# SDK and was getting the error below:
Error Unauthorized: {"message":"app.6619a48bdcd3d3361fbc@service.cloud.appwrite.io (role: applications) missing scope (public)","code":401,"type":"general_unauthorized_scope","version":"0.12.148"}
I realized that SDK on Github is not being updated. So I switched to REST API. Same error.
Initialization:
builder.Services.AddHttpClient<IAuthService, AuthService>(client => { client.BaseAddress = new Uri("https://cloud.appwrite.io/v1"); client.DefaultRequestHeaders.Add("X-Appwrite-Project", "********************"); client.DefaultRequestHeaders.Add("X-Appwrite-Key", "*************************************"); });
My method:
public async Task<dynamic> AuthenticateUserAsync(string email, string password) { var requestBody = new { email, password };
var jsonRequestBody = JsonSerializer.Serialize(requestBody);
var httpContent = new StringContent(jsonRequestBody, Encoding.UTF8, "application/json");
var response = await _httpClient.PostAsync("/v1/account/sessions/email", httpContent);
if (response.IsSuccessStatusCode)
{
var jsonResponse = await response.Content.ReadAsStringAsync();
return JsonSerializer.Deserialize<dynamic>(jsonResponse);
}
else
{
// Handle the error
System.Diagnostics.Debug.WriteLine($"Error {response.StatusCode}: {await response.Content.ReadAsStringAsync()}");
return null;
}
}
I have made 0 progress, if I can get this fixed, will go back to Supabase.

I got it to work finally. Apparently you dont include the API key in the initialization. It works if I comment that out.
Recommended threads
- when is password optional for updatePass...
In the document it says that the old password is option when updatingPassword but when i implemented it requires me to give it my old password. So when is the o...
- Unable to resolve "node-fetch-native-wit...
I using react native and want to use node.js to create a custom token but i get this error. i have done npm i node-fetch-native-with-agent to see if that solves...
- why do I get this error sometimes?
hello everyone, I am integrating authorization via Yandex into my application and I often get Error Error 400 There was an error processing your request. Please...
