$tm1Ui.applicationLogin question

canvas

#1

Hi Guys,

I was testing using the $tm1Ui.applicationLogin from my a controller, however I run into a CORS related error:

Using Canvas Version: 2.0.4:

function code:
$tm1Ui.applicationLogin(‘dev’,‘nsa’,‘nsa’).then(function(response){
$log.log(response );
});
chrome console error:

When I use the directive tm1-ui-login , things work ok though:

directive code:
< tm1-ui-login tm1-default-instance=“dev”>
(with typing in user: nsa, pswrd: nsa…)

Do I need to pass in an additional configuration object to $tm1Ui.applicationLogin function?
Or am I understanding/doing something incorrectly?

Thanks in advance!

Regards,
Gerhard


#2

Hi @gpool,

It may be appearing as well though not just as immediate as the above. The error is usually due to tm1web not accepting requests from different domain (different port or source ip).

They should normally be away when you add the following into the tm1web config:

<add key="CrossDomainAccessList" value="*" />

<add key="LegacyUrlApiSessionDiscoveryEnabled" value="False" />

The reference can also be found under Samples -> Setup:


Paul


#3

Many thanks Paul - that did the trick.
Regards,
Gerhard