[progress Communities] [progress Openedge Abl] Forum Post: Re: How To Identify Which User...

  • Thread starter Thread starter Sai Tharun Kollampally
  • Start date Start date
Status
Not open for further replies.
S

Sai Tharun Kollampally

Guest
Hope, following information would be helpful to you. There is no direct way of determining the userid of a client from the AppServer. However, this can be achieved through 4GL / ABL code that passes the userid of a client as a parameter to the AppServer in the CONNECT() method. Use an AppServer connect procedure to store that information in the SERVER-CONNECTION-CONTEXT attribute of the Appserver's SESSION handle. The connect procedure should be similar to the following: /* connect.p. */ DEFINE INPUT PARAMETER pcUserid AS CHARACTER NO-UNDO. DEFINE INPUT PARAMETER pcPassword AS CHARACTER NO-UNDO. DEFINE INPUT PARAMETER pcInfo AS CHARACTER NO-UNDO. ASSIGN SESSION:SERVER-CONNECTION-CONTEXT = pcUserid. Specify this procedure as the AppServer connect procedure in one of the following ways: In Progress Explorer: Open the AppServer Properties, go to Server -> Advanced features, type the connect procedure name in the field labeled 'Connect'. In OpenEdge Explorer: Navigate to Resources> OpenEdge> AppServer> asbroker2> Configuration and click the Edit button. In the Advanced section, type the connect procedure name in the field labeled 'Connect procedure'. In the ubroker.properties file: Add the 'srvrConnectProc' parameter in the section related to the desired AppServer. The client code should be similar to the following: DEFINE VARIABLE hServer AS HANDLE NO-UNDO. CREATE SERVER hServer. hServer:CONNECT("-H myhost -AppService asbroker1", "myUserid", "", ""). The second, third and fourth parameters in the CONNECT() method are passed as the first, second and third input parameters in the connect procedure on the AppServer respectively. The final result is that "myUserid" will be stored in SESSION:SERVER-CONNECTION-CONTEXT on the AppServer. Other programs running on the same AppServer agent can read SESSION:SERVER-CONNECTION-CONTEXT to retrieve the userid of the user connected to the AppServer. Note that for stateless and state-free AppServers, all requests from a connected client are not guaranteed to run on the same AppServer agent. See Progress article 000011213 for a technique to determine the connected userid from procedures running on a stateless AppServer.

Continue reading...
 
Status
Not open for further replies.
Back
Top