#C# .NET FRAMEWORK ERROR LOGIN

16 messages · Page 1 of 1 (latest)

shy sun
#

Login failed: [email protected] (role: applications) missing scope (public)
help pls C# .net framework app try to login

#

<@&634618551491100692>

outer cape
#

Also, avoid pinging everyone in the future 😅

shy sun
#

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
{

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



        client = new Client()
              .SetEndpoint("https://cloud.appwrite.io/v1") 
              .SetProject("66f39506eeeewqf1be18") 
              .SetKey("The key");
    }


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

                Session result = await account.CreateEmailPasswordSession(
                    email: "[email protected]",
                    password: "pass"
                );

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

    }
}
split furnace
split harbor
#

are you trying to use cloud or self hosted? What version of the sdk are you using?

split harbor
#

i asked because I noticed your endpoint is pointing to cloud

shy sun
#

okay

split harbor
#

try changing that to your appwrite instance and see

outer cape
#

@shy sun Remove your API key and create a new one, just in case. Same as the password: use a different one

shy sun
#

same error
but when i add the full code in button void section its work but in same time give me message error say : ** the given key 'mfa' was not in present in the dictionray**