[ODK Developers] Programatic login into ODK aggregate server

Authentication uses DigestAuth and ODK Aggregate expects a version header:

https://bitbucket.org/javarosa/javarosa/wiki/OpenRosaAPI

··· On Wed, Sep 2, 2015 at 2:17 PM, wrote:

Hi,

I am working on a web app that can use the Briefcase Aggregate API to sync
data from the aggregate server. But I am stuck as the basic authentication
is not working and I get "access denied" response even when using the right
username and password. Please help.

If someone has done this successfully, could you please share how.

Thanks,
GAURAV


Login function I am using:

$.ajax({
type: "GET",
url: ODKSubmissionURL,
async: false,
dataType: "xml",
contentType: "application/xml",
crossDomain: true,
headers: {
"Authorization": "Basic " + btoa(userID + ":" + password)
},
success: function (xmlData) {

        console.log(xmlData);

        $('#getFormAlertDiv').hide();
        $('#waitAlertDiv').show();

    },
    error: function (request, textStatus, errorThrown) {
        console.log(request.responseText);
        console.log(textStatus);
        console.log(errorThrown);
    }

});

--
You received this message because you are subscribed to the Google Groups
"ODK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com