Hello,
In the Ticketed Authentication, a content server ticket is used instead of the user password for authentication. In fact, Content server generates tickets usually start with a DM_TICKET qualifier. Below, two ways to get the ticket from content server: API instructions or DFC programming. There is a time limit to use the login ticket (by default 30 minutes), after this time a login using the ticket will fail.
API instructions
Connection to DA or dqMan with an ADMIN/SUPERUSER user account in order to execute getlogin API instruction. In the below example, there is the generation of an 2nd temporary password for the nominative account ozveren1 : “DM_TICKET=T0JKIE5VTEwgMAoxMwp2ZXJzaW9uIElOVCBTIDA[…]vY3RnRmc9PQo=”
3 | DM_TICKET=T0JKIE5VTEwgMAoxMwp2ZXJzaW9uIElOVCBTIDA[...]vY3RnRmc9PQo= |
DFC programming
01 | String superUser = "dmadmin" ; |
02 | String superUserPassword = "dmadmin" ; |
03 | String repoName = "mydocbase" ; |
04 | String username = "hozveren1" ; |
06 | IDfSessionManager sessMgr = null ; |
07 | IDfSession superUserSession = null ; |
09 | IDfSessionManager userSm = null ; |
10 | IDfSession userSess = null ; |
04 | IDfClientX clientX = new DfClientX(); |
05 | IDfClient localClient = clientX.getLocalClient(); |
06 | sessMgr = localClient.newSessionManager(); |
10 | IDfClientX clientX = new DfClientX(); |
11 | IDfLoginInfo li = clientX.getLoginInfo(); |
12 | li.setUser(superUser); |
13 | li.setPassword(superUserPassword); |
15 | if (sessMgr.hasIdentity(repoName)){ |
16 | sessMgr.clearIdentity(repoName); |
18 | sessMgr.setIdentity(repoName, li); |
22 | superUserSession = sessMgr.getSession(repoName); |
23 | String userTicket = superUserSession.getLoginTicketForUser(username); |
24 | System.out.println( "User ticket: " + userTicket); |
03 | IDfClientX clientX = new DfClientX(); |
04 | IDfClient localClient = clientX.getLocalClient(); |
05 | userSm = localClient.newSessionManager(); |
09 | IDfClientX clientX = new DfClientX(); |
10 | IDfLoginInfo li = clientX.getLoginInfo(); |
12 | li.setPassword(userTicket); |
14 | if (userSm.hasIdentity(repoName)){ |
15 | userSm.clearIdentity(repoName); |
17 | sm.setIdentity(repoName, li); |
20 | userSess = userSm.getSession(repoName); |
21 | System.out.println( "Got user session: " + userSess.getSessionId()); |
2 | if ((userSm != null ) && (userSess != null )){ |
3 | userSm.release(userSess); |
6 | if ((sessMgr != null ) && (superUserSession != null )){ |
7 | sessMgr.release(superUserSession); |
That’s all!!!
Huseyin OZVEREN
Related