Using the SSO token with the JavaScript API v3

Hiroyuki Adachi shared this question 49 days ago
Answered

I would like to use single sign-on with the JavaScript API v3.

In the case of the previous JavaScript API v2 and SOAP web services, we were able to achieve this by obtaining a token in SOAP's LOGINUSER service and including the obtained token in the parameters of the URL calling the API v2.

How can we achieve this in the case of JavaScript API v3 and REST API?


Also, does the REST API have the equivalent of SOAP's LOGINUSERNOPASSWORD service?


Translated with http://www.DeepL.com/Translator (free version)

Comments (2)

photo
1

Hi Hiroyuki.

We have a page with some documentation on using the new REST API for logging in with SSO tokens: https://developers.yellowfinbi.com/dev/api-docs/yf-api.html#tag/login-tokens

Although there are several options here, such as the refresh-token, you will probably want to use login-tokens as they have the full SSO feature list. I believe the section marked "Create an SSO login token without a valid access token" is the equivalent of SOAP's LOGINUSERNOPASSWORD service.

If that's not the case and it doesn't work, let me know.

Kind regards,

Chris

photo
1

Hi Chris.


Thanks for the reply!

I was relieved to see that the REST API also has the equivalent of LOGINUSERNOPASSWORD.


However, although the JavaScript API v2 was able to pass a log-in token in the URL parameter of a report or dashboard (https://wiki.yellowfinbi.com/display/yfcurrent/Basic+Use), I couldn't find the option for v3

(https://wiki.yellowfinbi.com/display/yfcurrent/Base+API).


How can I use the token obtained with the REST API in v3?

photo
1

Hi Hiroyuki,

There's a section on the page https://developers.yellowfinbi.com/dev/api-docs/yf-api.html#operation/createLoginToken that describes the login parameters you can use as well as some example code:

{


  • "signOnUser": {
    "userName": "anotherUser@yellowfin.com.au",
    "password": "test",
    "clientOrgRef": "ClientOrgRefId"
    },

  • "loginParameters": [
    "YFTOOLBAR=FALSE",
    "ENTRY=VIEWDASHBOARD",
    "DASHBOARDUUID=5678f33c-c666-4972-8976-9c489accf73b"
    ],

  • "noPassword": false,

  • "adminUser": {
    "userName": "admin@yellowfin.com.au",
    "password": "test"
    }

}


Is that what you are looking for?

Kind regards,

Chris

photo
1

Hi Chris,


Sorry I haven't replied.

In the end I was able to get it to work well with the code as attached.


Thanks for your support!

photo
1

Hi Hiroyuki!

Thanks for letting me know. I hope you don't mind I've saved your code, just in case this question comes up again.

Kind regards,

Chris

photo
1

Hi Chris!


Of course, saving the code is not a problem. Hope this helps with future questions!

photo
1

Hi Hiroyuki,

Thank you for confirming, I will now go ahead and mark this Questions as Answered.

Regards,

Mark

photo
photo
1

Hi Hiroyuki,

Hope you're having a good week.

Just wanted to check-in and see how it's all going. Was there anything you were needing from me to help get this resolved?


Regards,

Chris