Quantcast
Channel: Questions in topic: "web player"
Viewing all articles
Browse latest Browse all 531

WebPlayer WWW Authorization always prompts for credentials

$
0
0
Hello, when I upload my game to my web site (using Windows/IIS) and then connect to the web site via the browser it prompts me for the web service credentials. In my code I have filled in the credentials in the header and tried every thing I can think of but nothing makes this dialog go away except if I type in the user name and password in the browser which customers wouldn't (and shouldn't) know the credentials for. Here is my code: string url = Consts.MyAPIUrl; public IEnumerator TestWebService() { WWW www; byte[] toEncodeAsBytes = System.Text.Encoding.UTF8.GetBytes(UserName + ":" + UserPassword); string base64 = System.Convert.ToBase64String(toEncodeAsBytes); WWWForm form = new WWWForm(); var headers = form.headers; byte[] rawData = form.data; headers["Authorization"] = "Basic " + System.Convert.ToBase64String(System.Text.Encoding.ASCII.GetBytes(UserName + ":" + UserPassword)); www = new WWW(url, rawData, headers); yield return www; if (null != www) { List data= null; data = (List)LitJson.JsonMapper.ToObject> (www.text); } }

Viewing all articles
Browse latest Browse all 531

Trending Articles