I'm new to developing Windows 10 Universal Apps. I need to authenticate with Windows.Web.Http
with a blank/empty username and only with a password. If I use a empty string or null I've got an exception on creating the credentials.
Any idea?
Ok, i've got it by myself:
First I tried using (empty username throws Invalid Argument exception):
filter.ServerCredential = new Windows.Security.Credentials.PasswordCredential(uri.ToString(), username, pass);
Now I am using:
var buffer = Windows.Security.Cryptography.CryptographicBuffer.ConvertStringToBinary(username + ":" + pass, Windows.Security.Cryptography.BinaryStringEncoding.Utf8);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.