Receiving unauthorized error (401) from vuforia server

I am trying to implement vuforia api in c # code.

I get an error message from the server.

C # code:

ASCIIEncoding Encoding = new ASCIIEncoding(); MD5 md5 = MD5.Create(); string requestPath = "/targets"; string serviceURI = "https://vws.vuforia.com"+ requestPath; string httpVerb = "GET"; var contentMD5bytes = md5.ComputeHash(Encoding.GetBytes("")); string contentMD5 = BitConverter.ToString(contentMD5bytes).Replace("-", ""); string contentType = ""; System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US"); string date = string.Format("{0:r}", DateTime.Now.ToUniversalTime()); string StringToSign = String.Format("{0}\n{1}\n{2}\n{3}\n{4}", httpVerb, contentMD5, contentType, date, requestPath); // HTTP-Verb, Content-MD5, Content-Type, Date, Request-Path; HMACSHA1 sha1 = new HMACSHA1(System.Text.Encoding.ASCII.GetBytes(secretKey)); byte[] sha1Bytes = Encoding.GetBytes(StringToSign); MemoryStream stream = new MemoryStream(sha1Bytes); byte[] sha1Hash = sha1.ComputeHash(stream); string signature = System.Convert.ToBase64String(sha1Hash); HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(serviceURI); request.Headers.Add("Authorization", string.Format("VWS {0}:{1}", accessKey, signature)); request.Date = DateTime.Now.ToUniversalTime(); try { using (HttpWebResponse responses = request.GetResponse() as HttpWebResponse) { if (responses.StatusCode == HttpStatusCode.OK) { // Do stuff with response.GetResponseStream(); } } } catch (WebException ex) { } 

Upon reaching

The following error appears:
 WebResponse tResponse = tRequest.GetResponse(); 

Error: {"The remote server returned an error: (401)" Unauthorized ".}

I named the following URLs

https://developer.vuforia.com/forum/qcar-api/vms-api-using-c

Can anyone provide a solution for this.

+8
c # api vuforia
source share

No one has answered this question yet.

See related questions:

1658
Get int value from enum in C #
774
Get property value from string using reflection in C #
636
How to get type T from a member of a common class or method?
one
The remote server responded with an error: (401) Unauthorized
0
Chef API gets 401 Unauthorized error chef
0
Vuforia displays video downloaded from the Internet
0
how to convert string data to html in richtextbox
-one
How to get vuforia cloud recognition feature in Arcore (unity)

All Articles