cancel
Showing results for 
Search instead for 
Did you mean: 

Login To Alfresco API

coisox
Champ on-the-rise
Champ on-the-rise

Using this API, I can get the token to do some stuff:

https://mydomain/alfresco/service/api/login?u=myusername&pw=mypassword

But when I go to my Alfresco, I still be prompt for login:

https://mydomain/share/page/

I need a way (iframe cannot since cross domain) to auto login into my Alfresco. My web apps has a download button for files (stored in Alfresco) using this URL:

https://mydomain/share/proxy/alfresco/slingshot/node/content/workspace/SpacesStore/9684c587-d068-4af...

Without a live session, the download URL will return 401. This is the main reason why I need the session to be alived.

I've also tried this but fail (I got the idea when inspecting Alfresco login). I got error "Something's wrong with this page..."

<form action="https://mydomain/share/page/dologin" method="post">

    <input type="text" name="username" value="myusername">

    <input type="text" name="password" value="mypassword">

    <input type="text" name="success" value="/share/page/">

    <input type="text" name="failure" value="/share/page/?error=true">

</form>

These also give fail result:

https://mydomain/share/proxy/alfresco/slingshot/node/content/workspace/SpacesStore/9684c587-d068-4af...ticket=TICKET_587d4559521fcb37846f580c24529a3e81bc1f55

https://mydomain/share/proxy/alfresco/slingshot/node/content/workspace/SpacesStore/9684c587-d068-4af...alf_ticket=TICKET_587d4559521fcb37846f580c24529a3e81bc1f55

1 ACCEPTED ANSWER

afaust
Legendary Innovator
Legendary Innovator

If you have obtained a ticket from /alfresco you can use other ReST APIs on /alfresco to interact with the content of the system using the ticket as your authentication token. You can also use the ticket via CMIS using the special user name "ROLE_TICKET" and the ticket as the password.

View answer in original post

6 REPLIES 6

afaust
Legendary Innovator
Legendary Innovator

You cannot use tickets obtained from /alfresco to authenticate against /share. Alfresco Share does by default not support ticket based authentication.

If you need some form of auto-login, you should look into setting up external authentication via CAS or similar.

coisox
Champ on-the-rise
Champ on-the-rise

Thank you for your clarification. Actually I'm trying to avoid that route (CAS, SSO, LDAP) but it seems I have no other option

BTW, you did say "cannot use tickets obtained from /alfresco to authenticate against /share". Does this means, beside "share", I can put content into normal Alfresco so that I can get it using ticket?

afaust
Legendary Innovator
Legendary Innovator

If you have obtained a ticket from /alfresco you can use other ReST APIs on /alfresco to interact with the content of the system using the ticket as your authentication token. You can also use the ticket via CMIS using the special user name "ROLE_TICKET" and the ticket as the password.

coisox
Champ on-the-rise
Champ on-the-rise

Sorry sir I'm lost here when you said "ReST APIs on /alfresco". What is this called if its not REST API? It does contain the word "/alfresco"

https://mydomain/share/proxy/alfresco/slingshot/node/content/workspace/SpacesStore

coisox
Champ on-the-rise
Champ on-the-rise

Oh I think I got what you mean. "/alfresco" right after the domain name. Right?

afaust
Legendary Innovator
Legendary Innovator

Correct. The /share/proxy/alfresco is just a redirect via the Share application using the Share authentication (which does not support tickets itself).