Integrator - OpenLDAP - Password with special characters

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
jyoung
Posts: 690
Joined: Thu Jan 21, 2016 6:43 am
Location: Oklahoma City, OK USA

Integrator - OpenLDAP - Password with special characters

Post by jyoung » Tue Jul 07, 2020 11:30 pm

We use Integrator's OpenLDAP to authenticate users with Active Directory.

For the most part this works great, but we are running into an issue with users that have passwords with special characters like a parentheses.

The character in the password seems to blowing up the command.

The auth code looks like, where DN is the distinguished name that has been looked up via the SAMAccountName.

Code: Select all

#JSMXCMD := ('BIND HOST(&1) DN(&2) PASSWORD(&3)').Substitute( #LDAPServer #DN #wk_Password )
use builtin(JSMX_COMMAND) with_args(#JSMXHDLE #JSMXCMD) to_get(#JSMXSTS #JSMXMSG)
if (#COM_OWNER.Check( #JSMXSTS #JSMXMSG ) = False)
return
endif
Is there a way to escape the password or another way of dealing with password with special characters?

Thanks,
Joe

BrendanB
Posts: 45
Joined: Tue Nov 24, 2015 10:29 am

Re: Integrator - OpenLDAP - Password with special characters

Post by BrendanB » Wed Jul 08, 2020 4:14 pm

Joe,

I might be missing something, but i usually use double-quotes to escape things like passwords:

so using something like #jsmxcmd := ('BIND HOST(&1) DN(&2) PASSWORD("&3")').substitute(#Server #DN #Password)

usually that gets the password 'escaped'....

Code: Select all


#JSMXCMD := ('BIND HOST(&1) DN(&2) PASSWORD("&3")').Substitute( #LDAPServer #DN #wk_Password )
use builtin(JSMX_COMMAND) with_args(#JSMXHDLE #JSMXCMD) to_get(#JSMXSTS #JSMXMSG)
if (#COM_OWNER.Check( #JSMXSTS #JSMXMSG ) = False)
return
endif


jyoung
Posts: 690
Joined: Thu Jan 21, 2016 6:43 am
Location: Oklahoma City, OK USA

Re: Integrator - OpenLDAP - Password with special characters

Post by jyoung » Thu Jul 09, 2020 2:23 am

Brendan,

I can't tell you how long I spent looking at that trying to figure out how to do this.
For whatever reason, I never thought I could just wrap it double quotes. :roll:

That was exactly what I needed. lol

Thanks for replying.
Joe

Post Reply