1. Avory Rose Pastoral
  2. PowerBuilder
  3. Wednesday, 18 August 2021 01:13 AM UTC

Hi Everyone,

 

Good day! I was wondering if it is possible to do LDAP login in PB 12.5 CLASSIC. If its possible can you give me ideas on how to do it? Hoping to hear from anyone of you the soonest possible.

 

 

Thank you so much!

Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 18 August 2021 12:53 PM UTC
  2. PowerBuilder
  3. # 1

Hi Avory;

     Here is a presentation that I did at a PB conference on interfacing with Active Directory via LDAP from a PB Application.  HTH

https://sourceforge.net/projects/stdfndclass/files/Presentations/Active%20Directory

Regards ... Chris

 

Comment
There are no comments made yet.
Kevin Ridley Accepted Answer Pending Moderation
  1. Monday, 23 August 2021 14:57 PM UTC
  2. PowerBuilder
  3. # 2

You don't have to use a web service to authenticate.  I used the ADVAPI32.DLL.  Here is the Local External Functions you can use if you want to use that DLL.

function long LogonUser(string username, string domain, string password, long logontype, long logonprovider, ref ulong hToken) library "Advapi32" alias for "LogonUserA;Ansi"
function boolean CloseHandle(ulong w_handle) library "Kernel32.dll"
function long GetLastError() LIBRARY "kernel32" alias for "GetLastError"

 

I setup a nvo with a of_logon function that took arguments for Domain, User Id, PW and a reference string for error.

 

Long ll_rc
ulong lul_handle
CONSTANT LONG LOGON_TYPE = 3
CONSTANT LONG PROVIDER = 0
CONSTANT String FUNCTION_NAME = "of_logon"

ll_rc = LogonUser(as_user, as_domain, as_pw, LOGON_TYPE, PROVIDER, lul_handle)

IF ll_rc > 0 THEN
CloseHandle(lul_handle)
as_error = FUNCTION_NAME + " - success"
return 1
ELSE
// ll_rc = GetLasterror( )
as_error = FUNCTION_NAME + " - logon failed. Invalid user id or password. Please be sure to use your network id and password"
return ll_rc
END IF

Comment
There are no comments made yet.
Avory Rose Pastoral Accepted Answer Pending Moderation
  1. Friday, 20 August 2021 02:12 AM UTC
  2. PowerBuilder
  3. # 3

Hi thank you so much for your suggestion but I am just a newbie in PB world. I actually didn't know where to start in building ldap login. All I have is webservice URL Im really sorry. Do you have any idea what would be my first step? Thank you.

Comment
There are no comments made yet.
Avory Rose Pastoral Accepted Answer Pending Moderation
  1. Friday, 20 August 2021 03:20 AM UTC
  2. PowerBuilder
  3. # 4

Hi Sir, I follow this instruction
https://blogs.sap.com/2015/04/09/consuming-a-web-service-with-powerbuilder-125-classic/

but unfortunately can't make it work because of the pre requisite applications which is Visual C# 2010. Wasn't able to find any installer. How you can help me from scratch I'm really new into this. Thank you.

Comment
  1. Chris Pollach @Appeon
  2. Saturday, 21 August 2021 01:50 AM UTC
Hi Avory;

If this is a SOAP based web service and one that only requires TLS 1.0 security, then the SAP tutorial approach should work. However, if the Web Service you are trying to use requires TLS 1.2/1.3 security or its a REST based web service (not SOAP), then PB 12.5.x will not work. You would need to upgrade to Appeon PB 2019 R3 or higher in order to use (consume) those type of Web Services.

Regards ...Chris
  1. Helpful 1
  1. Arnd Schmidt
  2. Monday, 23 August 2021 14:41 PM UTC
We added some code in the constructor of the emitted C# Code, recompiled the c# code to a DLL and voila ... at least TLS 1.2 is working.

The version of Visual Studio is irrelevant, you need to have the right .NET 4.X SDK installed.

https://answers.sap.com/questions/10710280/powerbuilder-1252-classic-and-net-45.html

  1. Helpful 2
There are no comments made yet.
Avory Rose Pastoral Accepted Answer Pending Moderation
  1. Tuesday, 24 August 2021 00:37 AM UTC
  2. PowerBuilder
  3. # 5

Hi Thanks for your reply and help. In anyways, do you have a sample a zip file maybe? Or maybe you can tell me what is my first step would be. Thank you.

Comment
There are no comments made yet.
Avory Rose Pastoral Accepted Answer Pending Moderation
  1. Tuesday, 24 August 2021 01:28 AM UTC
  2. PowerBuilder
  3. # 6

Thank you so much for this. I really appreciate all the help. However, do you have a sample of it? Zip file? I am a newbie and in search of how to do it. I am creating a simple login that will consume ldap. 

Comment
There are no comments made yet.
Avory Rose Pastoral Accepted Answer Pending Moderation
  1. Tuesday, 24 August 2021 02:13 AM UTC
  2. PowerBuilder
  3. # 7

Totally appreciate your suggestion but I am just a newbie in PB world. I actually didn't know where to start in building ldap login. All I have is webservice URL Im really sorry. Do you have any idea what would be my first step? Thank you.

Comment
There are no comments made yet.
Avory Rose Pastoral Accepted Answer Pending Moderation
  1. Wednesday, 25 August 2021 00:26 AM UTC
  2. PowerBuilder
  3. # 8

Hi would you mind to share the complete code of your approach? I wan't to test it if it is working. If its not too much to ask. Thank you.

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.