internal void Authenticate(RawAccessTokenResponse token) { var verifyResult = EsiDataInterface.Verify(token.access_token); if (verifyResult != null) { VerifyUser(verifyResult, token); } }
internal static void ExportAccessToken(RawAccessTokenResponse tokenResponse) { var fileName = "AccessToken.eoi"; var exportFile = Path.Combine(_applicationDirectory, _personalDataDirectory, fileName); XmlSerializer serializer = new XmlSerializer(typeof(RawAccessTokenResponse)); TextWriter writer = new StreamWriter(exportFile); serializer.Serialize(writer, tokenResponse); writer.Close(); }
internal void VerifyUser(RawEsiVerify verifyResult, RawAccessTokenResponse token) { _fileSystemUser.TokenResponse = token; _fileSystemUser.Name = verifyResult.CharacterName; _fileSystemUser.Id = verifyResult.CharacterID; FileSystemDataInterface.ExportUsers(); this.Id = verifyResult.CharacterID; this.Name = verifyResult.CharacterName; if (_eoiUser != null) { _eoiUser.Name = verifyResult.CharacterName; _eoiUser.IsDefault = false; _eoiUser.Authenticated = true; _eoiUser.InvokePropertyChanged(); } CorporationWebInterface.RegisterUser(_fileSystemUser.Name); }
internal static void AuthenticateUser(RawAccessTokenResponse token) { var verifyResult = EsiDataInterface.Verify(token.access_token); if (verifyResult != null) { var user = GetUser(verifyResult.CharacterName); if (user != null) { user.VerifyUser(verifyResult, token); } else { var defaultUser = GetDefaultUser(); if (defaultUser != null) { defaultUser.VerifyUser(verifyResult, token); CreateDefaultUser(); } } } }