Foren

CMIS URL to open Alfresco document without authentification

thumbnail
Julian AFFAIRE, geändert vor 10 Jahren.

CMIS URL to open Alfresco document without authentification

New Member Beiträge: 6 Beitrittsdatum: 09.10.12 Neueste Beiträge
Hi all,

i have a custom liferay portlet that is connected with alfresco by CMIS with the following code:

Map<string, string> param = new HashMap<string, string>();
httpS = PortalUtil.getHttpServletRequest(request).getSession();
user = PortalUtil.getUser(request);
param.put(SessionParameter.USER, user.getLogin());
param.put(SessionParameter.PASSWORD, (String) httpS.getAttribute(WebKeys.USER_PASSWORD));
param.put(SessionParameter.ATOMPUB_URL, atomPubUrl);
param.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());
param.put(SessionParameter.OBJECT_FACTORY_CLASS, "org.alfresco.cmis.client.impl.AlfrescoObjectFactoryImpl");
...
SessionFactory factory = SessionFactoryImpl.newInstance();
Session session = factory.getRepositories(param).get(0).createSession();
</string,></string,>


My portlet lists alfresco documents and other thing. My problem is that I want to put for all documents a link that allow us to open the document in the browser without asking for an alfresco authentification. Currently, I call an alfresco service to have a connexion tiket with URL: http://{host}/alfresco/s/api/login?u={monLogin}&pw={monPassword}
And after that I make a link like this: https://{HOST}/alfresco/d/d/workspace/SpacesStore/{UUID}/{NAME}?ticket={TICKET}

That works, alfresco doesn't asked for an authentification and the document is opened in the browser. The problem is that Internet Explorer freezes until it has not finish to download the file (it can be very long depending on the file size).
This behaviour is ok (Internet Explorer loads well the document) when I open the document with the URL: https://{HOST}/alfresco/cmisatom/{REPO_ID}/content/{NAME}?id={DOCUMENT_ID};1.0. But with this URL, Alfresco opens a popup to ask for authentification (Adding the ticket at the end of this URL doesn't change nothing).

If someone has an idea how to have this feature, thanks in advance for your help.
thumbnail
Mika Koivisto, geändert vor 10 Jahren.

RE: CMIS URL to open Alfresco document without authentification

Liferay Legend Beiträge: 1519 Beitrittsdatum: 07.08.06 Neueste Beiträge
You'll probably find help better from Alfresco forums for alfresco issues.
thumbnail
Julian AFFAIRE, geändert vor 10 Jahren.

RE: CMIS URL to open Alfresco document without authentification

New Member Beiträge: 6 Beitrittsdatum: 09.10.12 Neueste Beiträge
Ok I asked me if it existed a way into liferay to obtain alfresco documents without this second authentification (because I have a CMIS session opened in my portlet).
I will ask to Alfresco too, thanks.
thumbnail
Mika Koivisto, geändert vor 10 Jahren.

RE: CMIS URL to open Alfresco document without authentification

Liferay Legend Beiträge: 1519 Beitrittsdatum: 07.08.06 Neueste Beiträge
Your portlet can get the binary stream from CMIS api or you could mount the Alfresco repository as remote doclib repository and access the files from there.
thumbnail
Dhaval Shah, geändert vor 8 Jahren.

RE: CMIS URL to open Alfresco document without authentification

New Member Beiträge: 12 Beitrittsdatum: 06.05.11 Neueste Beiträge
You might try to bypass the authentication process which alfresco is doing at its end.