innocenzi / MojangSharp

A C# wrapper library for Mojang API (no longer actively maintained)
Other
34 stars 6 forks source link

Error on try to authenticate #8

Open FabioZumbi12 opened 5 years ago

FabioZumbi12 commented 5 years ago

I am trying to use this lib on my project but i am having this erro on authenticate: image (Error message: The path has an invalid format)

This is the code:

using MojangSharp.Endpoints;
using MojangSharp.Responses;
using System;
using System.Windows.Forms;

namespace AreaZ12_Launcher
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Button1_Click(object sender, EventArgs e)
        {
            AuthenticateResponse auth = new Authenticate(new Credentials() { Username = "fabio.fmagalhaes12@gmail.com", Password = "Aaaa1111" }).PerformRequestAsync().Result;
            if (auth.IsSuccess)
            {
                label1.Text = "Sucesso: " + auth.AccessToken;
            } else
            {
                label1.Text = "Erro: ";
            }
        }
    }
}

The password its an example! I need to change something?