Http Auth via Ajax

Hello I am really new in OSM and I have my first problem. ^^
I want to develop a webapplication and my first step is that the user has to login. I want to use Ajax here but i do not know what URL I need to connect to the OSM Database. I thought that I have to go to the user details as you can see in the code. I use the “prototype.js” for the Ajax method. There is no error but I can connect with every name which is not right as you can imagine. I think that I do not have a right connection but why ?

Can anyone help me ?

That is my code:

var standardUrl = '';

function checkLogin(){

    var url = standardUrl + 'api/0.6/user/details';
    var params = new Object();

    params["userName"] = userName;
    params["userPassword"] = pwd;

    new Ajax.Request(url, {

        method: 'get',
        parameters: params,
        onSuccess: function(transport){
            var response = transport.responseText;
            // xmlOsmUser = response;
            if(trim(response) != "Couldn't authenticate you"){
                document.getElementById("formular").style.visibility = 'hidden';
                document.getElementById("login").style.visibility = 'hidden';               
                document.getElementById("logout").style.visibility ='visible';
                document.getElementById("logout").innerHTML = " "+ userName +" ";
                document.getElementById("logoutButton").style.visibility ='visible';
        onFailure: function() {
            return "-1";
        onException: function(request, exception) {
            alert("mist: " + exception + request);
            return "-1";


This is solved. thx

More details about the solution of your problem might be helpfull for others…

The forum uses an API function to check if the supplied username/password combo is correct…


That is one option. I check the user and pwd when the user starts to create a node so when I get the changesetid. When the response is ==“Couldn’t authenticate you” then something is wrong.