Skip to content
Back

C# .NET FRAMEWORK ERROR LOGIN

  • 1
  • Auth
  • Cloud
Osama
20 Apr, 2024, 11:42
TL;DR
C# .NET framework error when logging in to Appwrite service due to missing scope 'public'. Solution: Ensure the correct scope is set for the account during login.
Osama
20 Apr, 2024, 11:42

@Moderator

D5
20 Apr, 2024, 11:56

Could you send the code?

D5
20 Apr, 2024, 11:56

Also, avoid pinging everyone in the future 😅

Osama
20 Apr, 2024, 11:58

okay sry

Osama
20 Apr, 2024, 11:58

using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Net.Http; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using Appwrite; using Appwrite.Models; using Appwrite.Services; using Newtonsoft.Json;

namespace WindowsFormsApp1 { public partial class Form1 : Form {

TypeScript
    private Client client;
    public Form1()
    {
        InitializeComponent();



        client = new Client()
              .SetEndpoint("https://cloud.appwrite.io/v1") // Replace with your Appwrite endpoint
              .SetProject("6623950681416881be18") // Replace with your Appwrite project ID
              .SetKey("0b31aa733f199c287c635f93f29e81dfd61caab583a3d404bedadb94eea1d445790a2fb3ce627330ce9678aed19d42acae77f6a39eb3c0e5109f4e8cc2559b766d47b17995b3d4550d20c1530ce2fd532f515352810c94cc4cfbc50c69f8898571015206f91b1b6e328a42c2b6b0d995e2561046475bb7c22d8b597eb2d59bbe");
    }


    private async void button1_Click_1(object sender, EventArgs e)
    {
            try
            {
                Account account = new Account(client);

                Session result = await account.CreateEmailPasswordSession(
                    email: "osamawahed1234@gmail.com",
                    password: "01012683392"
                );

                // Login successful
                Console.WriteLine("Session ID: " + result.Id);
            }
            catch (AppwriteException ex)
            {
                // Error occurred during login
                Console.WriteLine("Login failed: " + ex.Message);
            }
        }

    }
}
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