我想将Pentaho与Silverlight平台集成。对于身份验证,有用于用户控制台的登录页面。我不想使用上面的登录页面登录,我想在后面的代码中登录。
我尝试了基本身份验证,但在新版本中将无法使用。
string[] parts = System.Text.RegularExpressions.Regex.Split(ae.Result, "/");
String data = "userid=" + App.UserName + "&password=" + App.Password;
WebClient webClient = new System.Net.WebClient();
Uri uri = new Uri("http://localhost:8080/pentaho/Home?" + data);
webClient.Headers["Content-Type"] = "application/x-www-form-urlencoded";
webClient.Encoding = Encoding.UTF8;
App.WindowManager.ConsoleWrite(uri.ToString());
webClient.UploadStringAsync(uri, "POST", "");
但是它可以与Pentaho的早期版本一起使用。我知道Pentaho中几乎没有其他可用的方法。但是它应该能够在Silverlight应用程序中执行。您是否知道在Silverlight应用程序中有其他解决方案?
提前非常感谢您!!!
使用查询字符串方法进行身份验证是一种不安全的方法,因此我找到了使用基本身份验证方法的解决方案。
WebClient webClient = new System.Net.WebClient();
Uri uri = new Uri("http://serverDomain:8080/pentaho/Home");
//Give user name and password here
var plainTextBytes = System.Text.Encoding.UTF8.GetBytes("username:password");
var encodedString = System.Convert.ToBase64String(plainTextBytes);
webClient.Headers["Authorization"] = "Basic " + encodedString;
webClient.Encoding = Encoding.UTF8;
App.WindowManager.ConsoleWrite(uri.ToString());
webClient.UploadStringAsync(uri, "POST", "");
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句