Hi
I followed the instructions for AD authorisation in the PowerServer docs. The code makes a call to BeginSession so that it has the AD Authorisation details when connecting. This all works fine.
I want to begin a new session following a session timeout, so I catch the error and rerun the same function used initially to restart the session as if from the beginning, but I get a -1 from the BeginSession call and Getapplication().GetHttpResponseStatusText() isn't returning any message.
I'm using LongConnection=1 for the DBCache connection, and I'm working on a Saas Model, so config details are held in the DB (PowerServer_ApplicationConfig, PowerServer_TransactionConfig, PowerServer_ConnectionConfig).
The code works for the initial login with either a Windows Login or an AD User name and password. I'm catching a 224 error.
Session fails to respond (Session does not exist). Please close or restart the application. (Web API: http://localhost:5099/api/ServerApi/RetrieveWithParm)
Is there something I'm missing?
Cheers
Jim
INT ll_rc
//-------------------------------------------------------
// https://docs.appeon.com/ps2022/Azure_Active_Directory.html#Modifying_the_PowerBuilder_client_app_for_Azure_AD
// *AD Authentication* STEP 5
//-------------------------------------------------------
Choose Case error.Number
Case 225 , 224 //Session Timeout Error - session does not exist
ll_rc = SQLCA.of_reconnect()
if ll_rc = -1 THEN
HALT CLOSE
END IF
Case 220 to 229 //Session Error
MessageBox ("Session Error", "Number:" + String(error.Number) + "~r~nText:" + error.Text )
Case 230 to 239 //License Error
MessageBox ("License Error", "Number:" + String(error.Number) + "~r~nText:" + error.Text )
Case 240 to 249 //Token Error
MessageBox ("Token Error", "Number:" + String(error.Number) + "~r~nText:" + error.Text )
//Authorization
gnv_app.of_Authorization()
Case Else
// Call ancestor system error
CALL SUPER::pfc_Systemerror
End Choose