How to retrieve FQDN with SecureLogin script

  • 7010083
  • 31-Jan-2012
  • 26-Apr-2012

Environment

Novell SecureLogin
NSL7.0.2
eDirectory enviornment

Situation

It is not possible to read a user's fully qualified distinguished name using the %DN variable.
SecureLogin has the ability to read many attributes from the directory.
However, nothing is returned when asking for the DN.
Type %DN returns error -603 (no such attribute).

Resolution

Two solutions, depending on the desired syntax:
 
1.  Use %FullDN    or   %FullNDSName
Note that these pre-pend an extra "."  at the front of the name.
This extra "." can be removed with the regsplit command, for example:
 
regsplit "\.(.*)" %FULLNDSNAME ?result   OR
regsplit "\.(.*)" %FULLDN ?result
 
The result will have the syntax cn=myuser,ou=myou,o=myorg
 
2.  Alternatively use ?sysuser for the user name and ?syscontext for the context, and  splice them together with the StrCat command.  For example: 
 
StrCat ?FQDN ?sysuser "." ?sycontext
 
The result will have the syntax myuser.myou.myorg
 
 
(Also note  that in an AD environment the variable %distinguishedName can be used)

Additional Information

The following notepad script illustrates some of the name - related eDirectory attributes that SecureLogin can and cannot read, and how to use ?SysUser and ?SysContext to create the FQDN:
 
Dialog
 Class "Notepad"
 Title "Untitled - Notepad"
EndDialog
 
###  These work  ###
Type "CN = " 
Type %cn
Type \n
Type "Fullname =  "
Type %fullname
Type \n
Type "UID =  "
Type %UID
Type \n
Type "sn =  "
Type %sn
Type \n
Type "Given Name =  "
Type %givenName  
Type \n
Type \n
Type "FullDN =  "
Type %FULLDN 
Type \n
Type "FULLNDSNAME =  "
Type %FULLNDSNAME 
Type \n
 
###  Commands to remove the extra "." from FullDN and FullNDSName
regsplit "\.(.*)" %FULLNDSNAME ?Result1
Type "Result from FULLndsNAME = "
type ?Result1
type \n
regsplit "\.(.*)" %FULLDN ?Result2
type "Result from FULLdn = "
type ?Result2
type \n
type \n
 
###  Commands to create the FQDN from system variables  ###
Type "sysuser = "
Type ?sysuser    
Type \n
Type "syscontext = "
Type ?sycontext
Type \n
StrCat ?FQDN ?sysuser "." ?sycontext
Type "FQDN = "
Type ?FQDN
type \n
type \n
 
###  These do not work  ###
Type "Name =  "
Type %Name  
Type \n
Type "User =  "
Type %User
Type \n
Type "DN =  "
Type %dn