You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
Has there been any further progress on this project? I have been trying to get it to work on my windows phone, which it does locally but not remotely.
It doesn't appear that the original code save the credentials or attempted to pass them to the uri.
I've got to the stage now where they are saving and I'm trying to pass them to openhab here:
public Uri ResolveRemoteUrl()
{
if (string.IsNullOrEmpty(RemoteHostname))
return null;
try
{
var scheme = UseHttps ? "https" : "http";
UriBuilder builder;
if (PortNumber.HasValue)
builder = new UriBuilder(scheme, RemoteHostname, PortNumber.Value);
else
builder = new UriBuilder(scheme, RemoteHostname);
builder.UserName = Username; /// Added for Authentication
builder.Password = Password; /// Added for Authentication
return builder.Uri;
}
catch
{
return null;
}
}
But it seems to fail. Any progress updates would be really appreciated. I'd love to get some sort of working windows phone interface for openhab.
James
The text was updated successfully, but these errors were encountered:
I just thought i'd follow up, in case anyone is following this. I've sort of got authentication working now, as below:
private HttpClient GetWebClient()
{
var filter = new HttpBaseProtocolFilter();
//filter.IgnorableServerCertificateErrors.Add(ChainValidationResult.Untrusted); - not needed when cert is installed
filter.IgnorableServerCertificateErrors.Add(ChainValidationResult.InvalidName);
var httpClient = new HttpClient(filter);
// Add an Accept header for JSON format.
httpClient.DefaultRequestHeaders.Accept.Add(new HttpMediaTypeWithQualityHeaderValue("application/json"));
// Add an Charset header for Unicode.
httpClient.DefaultRequestHeaders.Add("Accept-Charset", "utf-8");
httpClient.DefaultRequestHeaders.Add("Authorization", "Basic " + Convert.ToBase64String(StringToAscii(string.Format("{0}:{1}", Username, Password ))));
return httpClient;
}
Hi James,
I apologize for keeping silent. I'm currently swamped with other work and unfortunately while I'd love to can't do much on the project. Still hoping I can pick up sooner than later.
Thanks for contributing your solution. I'll try to modify the code soon.
Hi,
Has there been any further progress on this project? I have been trying to get it to work on my windows phone, which it does locally but not remotely.
It doesn't appear that the original code save the credentials or attempted to pass them to the uri.
I've got to the stage now where they are saving and I'm trying to pass them to openhab here:
But it seems to fail. Any progress updates would be really appreciated. I'd love to get some sort of working windows phone interface for openhab.
James
The text was updated successfully, but these errors were encountered: