REST API Script - how to determine the authenticated user's username within 1IM Script?

Would like to know API authenticated user account calling script function so that we can log which account is calling what API script with what parameters, and may be provide finer access control to the script functionality.

Right now, I see just one line in inetpub/..App_Data/Logs which shows the username that got authenticated, but how do I capture this information within the script being called?

Parents
  • In the called script you can add some logging (using NLOG) that uses the information from the Session:Principal.User class.

    For example: 

    • Session.Principal.User.Display
    • Session.Principal.User.AuthenticationType
    • Session.Principal.User.AuthModuleDisplay
    • Session.Principal.User.Name
    • Session.Principal.User.DialogUserUid
    • Session.Principal.User.Uid (UID of the related identity (Person). Can be NULL)

    HTH

Reply
  • In the called script you can add some logging (using NLOG) that uses the information from the Session:Principal.User class.

    For example: 

    • Session.Principal.User.Display
    • Session.Principal.User.AuthenticationType
    • Session.Principal.User.AuthModuleDisplay
    • Session.Principal.User.Name
    • Session.Principal.User.DialogUserUid
    • Session.Principal.User.Uid (UID of the related identity (Person). Can be NULL)

    HTH

Children