Can anyone help with the Authentication API with the new version 4.0.7?
I have a simple php website that I want to authenticate users by the API of Forma. I have followed the documentation and still does not work.
Authentication API
Re: Authentication API
Hi, you should provide more details. Code used to achieve the auth, what errors do you get, and so on.
Per supporto GRATUITO contattatemi in privato qui
Re: Authentication API
This is my simple code below. Is my API call correct? Also, this code worked for FORMA 2.3.0. I am not sure if anything changed.
Code: Select all
$params = array("username"=>'[email protected]', "password"=>'password');
$key = "testtesttest";
$secret = "password";
$codice_sha1 = strtolower(sha1(implode(',', $params) . ',' . $secret));
$codice = base64_encode($key . ":" . $codice_sha1);
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://lms.mylms.com/api/auth/authenticate",
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $params,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"X-Authorization: FormaLMS " . $codice,
],
));
$response = curl_exec($curl);
$error = curl_error($curl);
curl_close($curl);
$xml = simplexml_load_string($response);
$json = json_encode($xml);
$array = json_decode($json,TRUE);
echo json_encode($array);
Re: Authentication API
What do you obtain?
I mean, $response and/or $error ?
I mean, $response and/or $error ?
Per supporto GRATUITO contattatemi in privato qui
Re: Authentication API
The response data is the 404 server error saying that File or directory not found.
Re: Authentication API
It's the URL to be call correct? I suppose it's not https://lms.mylms.com/api/auth/authenticate...
If you're not able to debug such an easy problem, I'd suggest to hire a developer or you'll risk more serious issues.
If you're not able to debug such an easy problem, I'd suggest to hire a developer or you'll risk more serious issues.
Per supporto GRATUITO contattatemi in privato qui
Re: Authentication API
Can you or anyone show me a simple url for the API call?
For Forma version 4.0.7, Which of the follow should be the API url to check for username?
a) lms.forma.com/api/user/checkUsername
b) lms.forma.com/api/rest.php?q=/api/user/checkUsername
or
c) please provide an example URL call to the the rest api.
For Forma version 4.0.7, Which of the follow should be the API url to check for username?
a) lms.forma.com/api/user/checkUsername
b) lms.forma.com/api/rest.php?q=/api/user/checkUsername
or
c) please provide an example URL call to the the rest api.
Re: Authentication API
If your Forma instance is installed in https://lms.mylms.com/, your CURLOPT_URL should be https://lms.mylms.com/api/rest.php?q=/a ... thenticate
Per supporto GRATUITO contattatemi in privato qui