title: Minecraft username / uuid from accesstoken
body: <p>I can get <code>accesstoken</code> but I don't know how to get <code>username</code> and <code>uuid</code> from <code>accesstoken</code>, when I login it's gave me something like that</p>
  
  <blockquote>
    <p>{"accessToken":"123","clientToken":"123","selectedProfile":{"id":"123","name":"playername"},"availableProfiles":[{"id":"123","name":"playername"}]} </p>
  </blockquote>
  
  <p>Thanks!</p>
  
  <pre><code>private vstrong textoid Signin_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
  {
      try
      {
          bool isSignedIn = false;
          if (isSignedIn == true)
          {
              var request = (HttpWebRequest)WebRequest.Create("https://authserver.mojang.com/invalidate");
              request.ContentType = "application/json";
              request.Method = "POST";
  
              using (var streamWriter = new StreamWriter(request.GetRequestStream()))
              {
                  dynamic json = JsonConvert.SerializeObject(new
                  {
                      accessToken = Settings.Default.accessToken,
                      clientToken = Settings.Default.clientToken
                  });
              }
              Settings.Default.UUID = null;
              Settings.Default.accessToken = null;
              Settings.Default.clientToken = null;
          }
          else
          {
              var httpWebRequest = (HttpWebRequest)WebRequest.Create("https://authserver.mojang.com/authenticate");
              httpWebRequest.ContentType = "application/json";
              httpWebRequest.Method = "POST";
  
              using (var streamWriter = new StreamWriter(httpWebRequest.GetRequestStream()))
              {
                  dynamic json = JsonConvert.SerializeObject(new
                  {
                      agent = new
                      {
                          name = "Minecraft",
                          version = 1
                      },
                      username = email.Text,
                      password = password.Password
                  });
                  streamWriter.Write(json);
                  streamWriter.Flush();
                  streamWriter.Close();
              }
  
              var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();
              using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
              {
                  var result = streamReader.ReadToEnd();
                  ACCESS_TOKEN = result;
              } 
          }
      }
       catch (WebException)
      {
          MessageBox.Show("Login failed. Invalid username or password.");
      }
  }
  string ACCESS_TOKEN;
  
  public string GetAccessToken()
  {
      return ACCESS_TOKEN;
  }
  </code></pre>