cancel
Showing results for 
Search instead for 
Did you mean: 

using alfresco-js-api in the browser, I can only login using the ecm-ticket in the constructor

mehe
Elite Collaborator
Elite Collaborator

I'm using an AngularJS (1.6) SPA with the alfresco-js-api directly in the browser.

Thought I should be able to login with a valid ticket using 

var ticket="XXXXXXXXXXXXX"; //valid ticket inside
var alfrescoApiInst = new AlfrescoApi({ provider:'ECM' });
alfrescoApiInst.loginTicket(ticket).then(function (data) {
             console.log('valid ticket you are logged in');
         }, function (error) {
             console.error(error);
         });
‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

but this is not working.

But using the ticket in the constructor works

var alfrescoApiInst=new AlfrescoApi({ticketEcm:ticket,hostEcm:hostUrl,provider:"ECM"});
   

It works with the constructor, but did I miss anything or got it totally wrong?

1 ACCEPTED ANSWER

eugenio_romano
Elite Collaborator
Elite Collaborator

Hi Martin,

I opened an issue for you :

loginTicket(ticket) 400 response · Issue #209 · Alfresco/alfresco-js-api · GitHub 

please refer to it for further update.

In the meantime, I suggest you use constructor way.

View answer in original post

7 REPLIES 7
Getting started

Explore our Alfresco products with the links below. Use labels to filter content by product module.