I am trying to delete user with scim service.
When I call it through SoapUI and curl it works but when I create ajax call it returns 405 method not allowed
SOAPUI5
OAUTH2 token: my_token_for_oauth
Media type: application/json
CURL
This both worked and deleted the user.
AJAX DOESNT WORK FOR ME
$.ajax({
url: 'https://localhost:9447/wso2/scim/Users/token_of_user_to_be_deleted',
type: 'DELETE',
headers: { 'Content-Type':'application/json'},
xhrFields: {
withCredentials: true
},
beforeSend: function (request) {
request.setRequestHeader('Authorization', 'Bearer ' + that.oauth2.loadToken().access_token);
},
success: function() {
console.log("success")
},
error: function () {
console.log("error")
}
});
ERROR:
Cross-Origin Resource Sharing (CORS) Filter: Unsupported HTTP method: DELETE