Forum Discussion
I did not include in the post but I am calling http://lithiumstage.alloyentertainment.com/alloy/restapi/vc/authentication/sessions/login in CURL.
URL is correct as REST API retuning autenticaion failed error in result xml
BradC wrote:Can you please provide the REST API URL that you're calling? I don't see the CURLOPT_URL being set in your code.
Thanks,
Brad
Thanks for the extra info. The "Authentication Failed" error you are experiencing occurs when attempting to authenticate an administrator/moderator account (who has elevated permissions) and the client IP address that is sent in the SSO token is different than the user's IP who is trying to redeem the token.
To authenticate the user with the API, the IP address in the token needs to be the server's IP address (the server that is making the calls). You can manually set this using this call:
$liToken = $lithium->get_auth_token_value("89", "ismail", "ismail@gmail.com", $settings_array, $lithium->get_server_var("HTTP_USER_AGENT"), $lithium->get_server_var("HTTP_REFERER"), "EXTERNAL.IP.ADDRESS.HERE");
Please let me know how this works for you.
Thanks!
Brad
- ismail14 years agoAdept
There is no get_auth_token_value() function in lithium_sso.php which i was provided by lithium
Am i missing any file?
- BradC14 years agoKhoros Alumni (Retired)
Attached is the newest lithium_sso.php library we are using (with the get_auth_token_value() function).
- ismail14 years agoAdept
I have downloaded new lithiium_sso.php. Now php script not throwing error for function not found .
But REST API still returning authentication failed. here is the out put
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>