Alfresco login page bypassing

大城市里の小女人 提交于 2020-07-22 21:38:04

问题


I created a valid ticket using a webservice call...code shown below

$url="http://serverip:port/alfresco/service/api/login?u=xxx&pw=xxx";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
$response =curl_exec($ch);

Now using this ticket i want to authenticate alfresco without again entering username and password.Also i want to create a valid cookie JSESSIONID inside browser with this ticket...Is it feasible??

my purpose is to integrate a php application with alfresco....php application already has an authentication system...so i want to bypass the authentication of alfresco


回答1:


You need to append below parameter

alf_ticket="TICKET_WHICH_YOU_GET"

for further authentication.




回答2:


Finally i resolved the issue by calling the login page url http://ip:port/share/page/ via Curl with login parameters(username and pwd)...I got JsessionId as response from curl...Now i took that JsessionId and set inside the browser...so wen u click http://ip:port/share/page/ the login page is bypassed




回答3:


As per your suggestion, we are tried with below curl call but their is no JsessionId in response. can you please check and let me know the resolution

$post = [
    'username' => 'user',
    'password' => 'pass',
];

$ch = curl_init('http://ip:port/share/page/dologin/');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);

// execute!
$response = curl_exec($ch);

// close the connection, release resources used
curl_close($ch);

// do anything you want with your response
var_dump($response);

please suggest with the solution



来源:https://stackoverflow.com/questions/28360141/alfresco-login-page-bypassing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!