project BLF > class PAuthenticationQRA > method GetUser

Description

getUser API, get user based on session id


Parameters


icGlobalSessionIdinputcharacter
ocUserIdoutputcharacter
ocClientPrincipalObjectoutputcharacter
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


BLF
method Session.ApplicationLogin


program code (program1/pauthenticationqra.p)

define variable authService as class com.qad.qra.security.IAuthenticationService no-undo.
define variable sessService as class com.qad.qra.session.ISessionService no-undo.

authService = cast(com.qad.qra.core.GlobalServiceLocator:Current:GetInstance(
                      Progress.Lang.Class:GetClass("com.qad.qra.security.IAuthenticationService")),
                      com.qad.qra.security.IAuthenticationService).

authService:Authenticate (icGlobalSessionId, true, true).

sessService = cast(com.qad.qra.core.GlobalServiceLocator:Current:GetInstance(
                      Progress.Lang.Class:GetClass("com.qad.qra.session.ISessionService")),
                      com.qad.qra.session.ISessionService).

Assign ocUserId                = sessService:CurrentSession:GetPropertyValue (com.qad.qra.session.Constants:QFS, com.qad.qra.session.Constants:UserID)
       ocClientPrincipalObject = sessService:CurrentSession:GetPropertyValue (com.qad.qra.session.Constants:QFS, com.qad.qra.session.Constants:SessionToken).