Hello together,
we are using Visual Lansa for Web. Is there any possibility when running the program on SQL server to detect the Active Directory user?
Or is a login screen the only way to recognize the user?
Detect Active Directory User on SQL-Server
Re: Detect Active Directory User on SQL-Server
A server routine in a server module is needed to access that kind of resources and start the session, the login screen is just a way to get there, not required.
saying so, there is an example in the package manager, to login with microsoft.
Maybe that example can point you to a way to make it work.
saying so, there is an example in the package manager, to login with microsoft.
Maybe that example can point you to a way to make it work.
Re: Detect Active Directory User on SQL-Server
i guess this is a silly example, as I dont have active directory to test, but if i create a web page like this:
and a server module (#test714sm) like this:
I think I could get there.
Code: Select all
Begin_Com Role(*EXTENDS #PRIM_WEB) Theme(#SYS_THEME<MaterialDesignBlue>)
Define_Com Class(#STD_STRNG.EditField) Name(#STD_STRNG) DisplayPosition(1) Left(28) Parent(#COM_OWNER) TabPosition(1) Top(18) Width(381)
Evtroutine Handling(#Com_owner.Initialize)
Define_Com Class(#test714sm.whoami) Name(#whoami)
#whoami.Execute STD_STRNG(#STD_STRNG)
Endroutine
End_Com
Code: Select all
Begin_Com Role(*EXTENDS #PRIM_SRVM)
Srvroutine Name(whoami)
Field_Map For(*Output) Field(#STD_STRNG)
Def_List Name(#whoami) Fields(#STD_STRNG) Type(*Working) Entrys(1)
Use Builtin(SYSTEM_COMMAND) With_Args("B" 'whoami > c:\temp\whoami.txt') To_Get(#STD_NUM)
Use Builtin(transform_file) With_Args(#whoami 'c:\temp\whoami.txt') To_Get(#io$sts)
Get_Entry Number(1) From_List(#whoami)
Endroutine
End_Com
Re: Detect Active Directory User on SQL-Server
Unfortunately, I can not call the examples. As soon as I click on the Package Manager the message appears:
A fatal error has occured. Lansa Tools was unable to download the required application files. Please contact Lansa Support
Great thanks for the info and the tip with "whoami" and saving to a text file. I will try it.
-------
When I use the whoami locally on my environment, I get the Active Directory user.
If I call the program from my browser on the mysql server, I get the database user accessing the SQL database.
A fatal error has occured. Lansa Tools was unable to download the required application files. Please contact Lansa Support
Great thanks for the info and the tip with "whoami" and saving to a text file. I will try it.
-------
When I use the whoami locally on my environment, I get the Active Directory user.
If I call the program from my browser on the mysql server, I get the database user accessing the SQL database.
Re: Detect Active Directory User on SQL-Server
try again the package, it is working now (I am in V15 epc 150040):