c# - Provide Credentials for BackgroundTransferRequest (WP8) -
when using httpwebrequest use following code set credentials
httpwebrequest request = (httpwebrequest)webrequest.create(urltocall); request.method = "get"; request.credentials = new networkcredential(username, pass);
how do same when using backgroundtransferservice in windows phone 8.
for reference using following.
http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh202955%28v=vs.105%29.aspx
http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh202959%28v=vs.105%29.aspx
*edit: authentication method digest in authorization header when use browser download file.
digest username="adf", realm="bcd", nonce="xxxxxxxxx", uri="/ans/1268e52399.txt", algorithm=md5, response="xxxxxxxxxxxxxxx", qop=auth, nc=00000001, cnonce="xxxxxxxxxxxx"
unfortunately isn't supported on backgroundtranserservice. 1 possible solution might manually create header request below:
var credentials = new utf8encoding().getbytes(username + ":" +password); var transferrequest = new backgroundtransferrequest(transferuri); transferrequest.headers["authorization"] ="basic " + convert.tobase64string(credentials);
unfortunately i'm unable test @ minute, give try , let me know how on.
Comments
Post a Comment