Esempio n. 1
0
        private async void btnRequestToken_Click(object sender, EventArgs e)
        {
            SpartanAuthentication.Token tok;

            if (txtSpartanToken.Text != "" && cbSkipSTGeneration.Checked)
            {
                tok = new SpartanAuthentication.Token
                {
                    SpartanToken    = txtSpartanToken.Text,
                    UserInformation = new SpartanAuthentication.UserInformation
                    {
                        Gamertag = txtGamertag.Text
                    }
                };
                _dot = new AuntieDotManager(tok.SpartanToken, tok.UserInformation.Gamertag);
                UpdateStatus("Inserted Spartan Token");

                return;
            }

            tok = await SpartanAuthentication.RequestToken(txtOAuthToken.Text);

            _dot = new AuntieDotManager(tok.SpartanToken, tok.UserInformation.Gamertag);
            txtSpartanToken.Text = tok.SpartanToken;
            txtGamertag.Text     = tok.UserInformation.Gamertag;
            UpdateStatus("Generated Spartan Token");
        }
Esempio n. 2
0
        private async void btnDoAuth_Click(object sender, EventArgs e)
        {
            var wlidtoken = await WLIDAuthentication.RequestToken(txtEmail.Text, txtPassword.Text);                   UpdateStatus("WLID OAuth Token Generated");

            txtOAuthToken.Text = wlidtoken.AccessToken;

            var spartanToken = await SpartanAuthentication.RequestToken(wlidtoken.AccessToken);                          UpdateStatus("Spartan Token Generated");

            txtSpartanToken.Text = spartanToken.SpartanToken;

            _dot = new AuntieDotManager(spartanToken.SpartanToken, spartanToken.UserInformation.Gamertag);   UpdateStatus("AuntieDot Initalized");

            await _dot.GetServicesListAsync();

            lbServices.Items.Clear();
            foreach (var service in _dot.ServicesList.ServiceList)
            {
                lbServices.Items.Add(service.Value);
            }
            UpdateStatus("Services List Recieved");

            txtHeaders.Text = string.Format("X-343-Authorization-WLID: v1={0}\r\nX-343-Authorization-Spartan: {1}",
                                            wlidtoken.AccessToken, spartanToken.SpartanToken);
            UpdateStatus("Populated Headers");
        }