Login via token

  • Jennifer Häfner
    Moderator
      Has successfully completed the online course Intermediate (200)
      Has successfully completed the online course Advanced (300)
      Has successfully completed the online course Basics (100)
      Has successfully completed the online course Advanced (310)
      Has successfully completed the online course Advanced (320)
      Has successfully completed the Intermediate Certification
      Has successfully completed the Advanced Certification
    2 years, 4 months ago #35833
    Up
    1
    Down
    ::

    Hi Vasileios,

    When your URL contains the Simplifier token, you can access it in an Auto Field. Set the Auto Field type to ‘URL’, the characteristic to ‘Query Parameter’ and the Query Parameter to the name of the query parameter in the URL where the token is stored.

    In the Process Designer, add a UI action that stores the value of the Auto Field in a Global Variable. After that, in a CSBO function (or in a script), set the token with the following code snippet:

    var sToken = this.getGlobals().getVar("token"); // the global variable where your token from the auto field is stored
    this.Permission._setAjaxHeader(sToken);

    With that code, the user corresponding to the Simplifier token is logged in.

    Jennifer Häfner
    Moderator
      Has successfully completed the online course Intermediate (200)
      Has successfully completed the online course Advanced (300)
      Has successfully completed the online course Basics (100)
      Has successfully completed the online course Advanced (310)
      Has successfully completed the online course Advanced (320)
      Has successfully completed the Intermediate Certification
      Has successfully completed the Advanced Certification
    2 years, 4 months ago #35836
    Up
    1
    Down
    ::

    In our Standard Content, there is a Client-Side Business Object function to fetch the current user’s Simplifier token: ‘ITIZ_Utilities’ – ‘GetUserToken’. You can use this token to trigger the login via script/CSBO.

    Vasileios Thanasias
    Participant
      Has successfully completed the online course Basics (100)
    2 years, 4 months ago #35839
    Up
    1
    Down
    ::

    Thank you very much. It seems it is working now.

    Do you know for long this token is valid? And whether I can change the valid period?

    Jennifer Häfner
    Moderator
      Has successfully completed the online course Intermediate (200)
      Has successfully completed the online course Advanced (300)
      Has successfully completed the online course Basics (100)
      Has successfully completed the online course Advanced (310)
      Has successfully completed the online course Advanced (320)
      Has successfully completed the Intermediate Certification
      Has successfully completed the Advanced Certification
    2 years, 4 months ago #35840
    Up
    1
    Down
    ::

    You can configure the token validity on your Simplifier instance (if you have admin permissions):

    In the user menu on the upper right side, select the item ‘settings’. In the tab ‘Server’, you define how long the token should be valid.

    https://community.simplifier.io/doc/installation-instructions/admin-settings/#server-settings

    Vasileios Thanasias
    Participant
      Has successfully completed the online course Basics (100)
    2 years, 4 months ago #35835
    Up
    0
    Down
    ::

    I see. Then I am getting a wrong token. Is there a way to get the Simplifier token from the logged user?

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.