cancel
Showing results for 
Search instead for 
Did you mean: 

Ticket authentication using new OpenCMIS URLs in Alfresco 4

amitp85
Champ in-the-making
Champ in-the-making
Starting with Alfresco 4, the web script based CMIS implementation (http://localhost:8080/alfresco/service/cmis) is deprecated. Where possible, you should use the OpenCMIS implementation instead (http://localhost:8080/alfresco/cmisatom).

In a quick test using curl, I noticed that when a user does not have access to Company Home, the old implementation fails while the new implementation succeeds.

Jeff

Dear Jeff,

How should I authenticate the user to access http://localhost:8080/alfresco/cmisatom ? I've tried sending "alf_ticket" (http://localhost:8080/alfresco/cmisatom?alf_ticket=TICKET_bdbd0697d81a40f782ba8b54615abad21dc663fd) parameter obtained from http://localhost:8080/alfresco/service/api/login?u=username&pw=password. But still cmisatom gives "Authorization Required" error. I'm trying to hit URLs using curl not using any API.

Though HTTP authentication works (curl –user "usernameSmiley Tongueassword" http://localhost:8080/alfresco/cmisatom). But that way I have to send it with each request and alfresco will authenticate user everytime. Is there a similar way to use session token like alf_ticket with cmisatom url ?

Alfresco version: 4.0.c

Regards
Amit
9 REPLIES 9

jpotts
World-Class Innovator
World-Class Innovator
amitp85,

I don't know, to be honest. I just realized this didn't work this week. I'll ask around. This may take some debugging and some source inspection to figure out whether or not ticket authentication is intended to be supported with the OpenCMIS URLs.

Jeff

amitp85
Champ in-the-making
Champ in-the-making
jeff

Thanks for your reply. This is not a blocker, I appreciate if you can post an update in future.

Regards
Amit

jm_pascal
Star Contributor
Star Contributor
Hello,

The answer is here : https://issues.alfresco.com/jira/browse/ALF-7074

Ticket can be specified in password, if any of the following are true:

a) username is not specified (i.e. null, or length of zero)
b) username is equal to "ROLE_TICKET" (case insensitive)

Hope it helps  Smiley Happy

jpotts
World-Class Innovator
World-Class Innovator
Works like a charm…
>>> client = CmisClient('http://localhost:8080/alfresco/cmisatom', '', 'TICKET_e5ce8e2a36af2188dbda30bee4d0633db4605a6c')
>>> repo = client.defaultRepository
>>> repo.id
u'1b8980cc-1f1b-4ac3-b26f-17aeee0cefc9'
>>> repo.name
u'Main Repository'
>>> repo.rootFolder.name
u'Company Home'
Thanks, Jean-Marie!

Jeff

amitp85
Champ in-the-making
Champ in-the-making
Hello,

The answer is here : https://issues.alfresco.com/jira/browse/ALF-7074

Ticket can be specified in password, if any of the following are true:

a) username is not specified (i.e. null, or length of zero)
b) username is equal to "ROLE_TICKET" (case insensitive)

Hope it helps  Smiley Happy

ah.. finally.

Its working fine. Thanks a lot.

amitp85
Champ in-the-making
Champ in-the-making
Works like a charm…
>>> client = CmisClient('http://localhost:8080/alfresco/cmisatom', '', 'TICKET_e5ce8e2a36af2188dbda30bee4d0633db4605a6c')
>>> repo = client.defaultRepository
>>> repo.id
u'1b8980cc-1f1b-4ac3-b26f-17aeee0cefc9'
>>> repo.name
u'Main Repository'
>>> repo.rootFolder.name
u'Company Home'
Thanks, Jean-Marie!

Jeff

Jeff,

Thanks a lot for your help.

r_kubiak
Champ in-the-making
Champ in-the-making
That means, I need to use the not cmis-standard url http://localhost:8080/alfresco/service/api/login?u=username&pw=password to authenticate later against cmis?

Is there any cmis-pure way?

kaynezhang
World-Class Innovator
World-Class Innovator
If you have username and password ,you can just use them to authenticate direclty using OpenCMIS instead of using ticket.There are many examples you can find.

ctan
Champ in-the-making
Champ in-the-making
The "old" URL: http://localhost:8080/alfresco/cmisatom written in http://docs.alfresco.com/5.0/pra/1/tasks/opencmis-ext-workbench.html doesn't seem to work with ticket based authentication on 4.2.x, but the following one does:

http://localhost:8080/alfresco/api/-default-/public/cmis/versions/1.1/atom/ from http://docs.alfresco.com/community/pra/1/concepts/cmis-request-url-format-onpremise.html

Not sure whether this is related but the "old" URL has a pattern /cmisatom that's being intercepted by a "CMIS security context cleaning filter" in web.xml.