How to log in and redirect to page using one url

cancel
Showing results for 
Search instead for 
Did you mean: 
alfresco_lover
Active Member

How to log in and redirect to page using one url

Hi,

I would like to see content of pdf file via alfresco CMIS 1.0 AtomPub Service Document.

When I enter this link: http://localhost:8081/alfresco/s/api/node/content/workspace/SpacesStore/26b11458-5059-48dd-989d-9183... to my browser I need to log in and then I can see content of file. Everything works as it should.

I would like to do the same thing in script but I cant find rigth url that would log me in and redirect me to content of file in one url.

Is there a way how this can be done ? 

Thanks 

3 Replies
angelborroy
Alfresco Employee

Re: How to log in and redirect to page using one url

You can use this kind of URL:

http://localhost:8080/alfresco/api/-default-/public/cmis/versions/1.0/atom/content/Sample.pdf?id=09c...

Including your document name ("Sample.pdf") and your document id ("09c6585e-c6a3-4362-9c99-4632a2868d23"). Just remove the "workspace/SpacesStore/" to get this required id.

Hyland Developer Evangelist
alfresco_lover
Active Member

Re: How to log in and redirect to page using one url

your link do not work. Because I still need to log in in modular window and then i see content.

angelborroy
Alfresco Employee

Re: How to log in and redirect to page using one url

You need to add Basic Auth header. For instance, using curl you can type following command:

curl --location --request GET 'http://localhost:8080/alfresco/api/-default-/public/cmis/versions/1.0/atom/content/Sample.pdf?id=887b6ef5-7651-4c3a-918d-85706364d65a' \
--header 'Authorization: Basic YWRtaW46YWRtaW4='
Hyland Developer Evangelist