Click here to Skip to main content
15,899,026 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello friends,
I had created website and i want to integrate Auth0.com (third party) into my application.The problem is that i had created one web api in asp.net and i want to call api inside auth0 when request goes to change password.
Is there any one who knows that very well.Please help me.

What I have tried:

1)$.ajax({
url: 'http://localhost:2615/api/data/userdata/updatepass',
method: 'POST',
data: {
email:email,
Motdepasse:newPassword
}
}).then(function(data) {
return callback(data);
}, function() {
return callback("Error reaching server endpoint");
});


2)
var newName = 'John Smith',
xhr = new XMLHttpRequest();

xhr.open('POST', 'http://localhost:2615/api/data/userdata/updatepass');
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xhr.onload = function() {
if (xhr.status === 200 && xhr.responseText !== newName) {
alert('Something went wrong. Name is now ' + xhr.responseText);
}
else if (xhr.status !== 200) {
alert('Request failed. Returned status of ' + xhr.status);
}
};
xhr.send(encodeURI('name=' + newName));
Above opsition i had tried but no solution.
Posted
Updated 31-May-17 0:07am

1 solution

}).then(function(data){ should be replace by Success: function(data)

Correct format of $ajax is below:

$.ajax({
                   type: "POST",
                   url: "xxxx",
                   data: xxxx,
                   contentType: "application/json; charset=utf-8",
                   dataType: "json",
                   success: function (response) {

                   }
               });
 
Share this answer
 
Comments
Member 12270370 2-Jun-17 3:06am    
Thanks for your reply but in auth0.com ,its shows an error as '$' is undefined.
deepankarbhatnagar 2-Jun-17 6:35am    
Add this script on your page:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900