AnsweredAssumed Answered

Login To Alfresco API

Question asked by coisox on Jul 5, 2018
Latest reply on Jul 8, 2018 by afaust

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-4afb-b0d6-8b18e2365ea7/TESTING.docx?a=true

 

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-4afb-b0d6-8b18e2365ea7/TESTING.docx?a=true&ticket=TICKET_587d4559521fcb37846f580c24529a3e81bc1f55

https://mydomain/share/proxy/alfresco/slingshot/node/content/workspace/SpacesStore/9684c587-d068-4afb-b0d6-8b18e2365ea7/TESTING.docx?a=true&alf_ticket=TICKET_587d4559521fcb37846f580c24529a3e81bc1f55

Outcomes