Perspective: Get Username & Password in scripting (LDAP Auth)

Hello,

I was looking for a way to use Username & password for logged users to scripts (mostly in scripting tag) from LDAP login.

In few words we are using some old web services over SOAP endpoint and we need to start session using user & password. Also need to maintain HTTP basic login.

Pretty annoying. I was close to achieve something amazing with Perspective but authentication is painful. Really need a way to inject user and password in script to trigg my Web Service.

Also tried to build my "own" login portal using password field and label text but it's very complicated.. Will have like 250 users working with that tools i need a clean way to address authentication

Thank you!
Sebastian

You're probably not going to be able to get a user's login/password from an LDAP login as this information is probably (almost certainly) hashed and isn't reversible (different from being encrypted which is reversible). You'll probably need to roll your own login system that doesn't use LDAP at all or build a lookup table that encrypts the user passwords but ANYTHING you do will compromise security due to this requirement.

i tried to do my own session login by saving input from users from Perspective View

but i can get user and password saved somewhere unique to the session and accessible from script to fill my needed information such as HTTP authentication (User + Password)

I will have around 250 users and can not create single tag for each or have custom cooking configuration. Data captured in Input form seems to also be stuck in view and can not be reused in scripting such as Tag Editor for Memory Tag. Having a database populated also seems to be a struggle as i going to need to retrieve the correct dynamic information per users.

See some screenshot. Web Service modul from sepasoft (already requested help from them). In red box field that i need to retrieve dynamically from session (user + password) or by anyways.

A working example in script but related to a fixed user & password added in Web Service module

A non working example


Code:
def valueChanged(tag, tagPath, previousValue, currentValue, initialChange, missedEvents):
system.ws.runWebService("startSession",
None,
{
'startSession': {
'sessionContext': {
'userName': session.props.auth.user.userName}}})
system.ws.runWebService("XXXXXXXXXXXXXXXX",
None,
{
'moveLotToInventory': {
'lotId': str(currentValue.getValue())}})

Thanks having taking time to help me by the way!
Sebastian.