php - Crowd RESTful API cannot connect


I'm trying to use Crowd authentication into my website but I keep getting 401 Application failed to authenticate. I don't know why because I am passing in the application username and password correctly. What I have:

$data = array("value" => "APP_PASS");
$data_string = json_encode($data);

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'http://PATH:8095/crowd/rest/usermanagement/2/authentication?username=APP_NAME');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");                                                                     
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);                                                                  
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);                                                                      
curl_setopt($ch, CURLOPT_HTTPHEADER, array(                                                                          
    'Content-Type: application/json',                                                                                
    'Content-Length: ' . strlen($data_string),
    'Accept: application/json'

$output = curl_exec($ch);

echo $output;




You need to use CURLOPT_HTTPAUTH and CURLOPT_USERPWD for your application user:password. Crowd uses ACLs for the requesting application as well as the user authentication you're requesting.

curl -i -u 'APP_USER:APP_PASS' --data '{"value": "USER_PASS"}' https://SERVER_URL/crowd/rest/usermanagement/1/authentication?username=USER_ID --header 'Content-Type: application/json' --header 'Accept: application/json'

People are also looking for solutions to the problem: fopen access denied no access to php.ini


Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.