[Solved] Basic Auth in metro app using C# [closed]

I assume you’re talking about Basic Http Authentication, if you’re using HttpClient to make your web service calls then you can enable set a Basic authentication header with the following code. var request = new HttpRequestMessage(HttpMethod.Get, uri); var token = Convert.ToBase64String(Encoding.UTF8.GetBytes(String.Format(“{0}:{1}”, username, password))); request.Headers.Authorization = new AuthenticationHeaderValue(“Basic”, token); The simplest (and cleanest) way, however: var … Read more

[Solved] How should IBuffer objects generated through Windows.Security.Cryptography be managed securely?

You can wipe out the buffer if you like after use, even with C#. Here is a handy helper: public static class BufferExtensions { public async static Task ClearContentsAsync(this IBuffer buff) { var writer = new DataWriter(buff.AsStream().AsOutputStream()); for (var i = 0; i < buff.Capacity; i++) writer.WriteByte(42); await writer.StoreAsync(); } } Use it like this: … Read more