inorganik / digest-auth-request

Make digest-auth requests with vanilla javascript
MIT License
70 stars 49 forks source link

Fails to connect in Cordova app #42

Closed dawiinci closed 4 years ago

dawiinci commented 4 years ago

Unfortunately I get this error in Cordova. You mentioned in another issue that it works.

CredStore - performQuery - Error copying matching creds. Error=-25300, query={ class = inet; "m_Limit" = "m_LimitAll"; ptcl = htps; "r_Attributes" = 1; sdmn = "Indigo Control Server"; srvr = "url"; sync = syna; }

The app is pretty basic and just set up without modifications. I just inserted the code from readme. Do you have any idea what I am missing? Thanks

inorganik commented 4 years ago

That's not related to digest auth request - https://www.google.com/search?q=Error+copying+matching+creds.&oq=Error+copying+matching+creds.&aqs=chrome..69i57j0l6j69i61.503j0j7&sourceid=chrome&ie=UTF-8

dawiinci commented 4 years ago

Unfortunately I don't know what to do. I already read through most of the threads with no success.

Since you have it working in Cordova I was hoping you could give me a hint.

inorganik commented 4 years ago

Yea that was back in 2013 when I created this lib....

inorganik commented 4 years ago

I would help you if I could but I haven't used cordova in years. I would reopen but clearly it's not related to digest-auth-request because there are so many posts and even some open issues about it... keep at it and post anything here that you find. Thanks and sorry I can't help.

dawiinci commented 4 years ago

I managed to get the CORS limitation aside with developer options in the browser (for testing). When running the script on Safari it actually opens the credential screen and I have to enter the password manually. I guess the same is happening in Cordova.

This shouldn't be, right?

You can easily test this with this code:

<!DOCTYPE html>
<html>
    <head>
        <script src="digestAuthRequest.min.js"></script>
        <script src="md5.js"></script>
        <script>var getRequest = new digestAuthRequest("GET", "https://postman-echo.com/digest-auth" , "postman", "password");
        getRequest.request(function(data) {
                                  alert("done");
                       });
</script>
    </head>
<body>
</body>
</html>
dawiinci commented 4 years ago

I will switch to Basic Auth (over SSL) and use this one: https://github.com/silkimen/cordova-plugin-advanced-http