JavaBlog.fr / Java.lu API DCTM,DFC DCTM,Documentum,DQL DCTM Documentum : Ticketed Authentication, Generation Of DM_TICKET

Documentum : Ticketed Authentication, Generation Of DM_TICKET

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=”

1API>getlogin,c,ozveren1
2...
3DM_TICKET=T0JKIE5VTEwgMAoxMwp2ZXJzaW9uIElOVCBTIDA[...]vY3RnRmc9PQo=
4API> quit
5Bye

 
DFC programming

01String superUser = "dmadmin";
02String superUserPassword = "dmadmin";
03String repoName = "mydocbase";
04String username = "hozveren1";
05 
06IDfSessionManager sessMgr = null;
07IDfSession superUserSession = null;
08 
09IDfSessionManager userSm = null;
10IDfSession userSess = null;
01try{       
02// ----- SUPER USER --- Creates a new session manager instance.
03{
04    IDfClientX clientX = new DfClientX();
05    IDfClient localClient = clientX.getLocalClient();
06    sessMgr = localClient.newSessionManager();
07}
08// Adds a new identity to the session manager.
09{
10    IDfClientX clientX = new DfClientX();
11    IDfLoginInfo li = clientX.getLoginInfo();
12    li.setUser(superUser);
13    li.setPassword(superUserPassword);
14    // check if session manager already has an identity. if yes, remove it.
15    if (sessMgr.hasIdentity(repoName)){
16        sessMgr.clearIdentity(repoName);
17    }
18    sessMgr.setIdentity(repoName, li);
19}
20 
21// ----- GENERATION of USER TICKET
22superUserSession = sessMgr.getSession(repoName);
23String userTicket = superUserSession.getLoginTicketForUser(username);
24System.out.println("User ticket: " + userTicket);
01// ----- USER TICKET --- Creates a new session manager instance.
02{
03    IDfClientX clientX = new DfClientX();
04    IDfClient localClient = clientX.getLocalClient();
05    userSm = localClient.newSessionManager();
06}
07// Adds a new identity to the session manager.
08{
09    IDfClientX clientX = new DfClientX();
10    IDfLoginInfo li = clientX.getLoginInfo();
11    li.setUser(username);
12    li.setPassword(userTicket);
13    // check if session manager already has an identity. if yes, remove it.
14    if (userSm.hasIdentity(repoName)){
15        userSm.clearIdentity(repoName);
16    }
17    sm.setIdentity(repoName, li);
18}
19 
20userSess = userSm.getSession(repoName);
21System.out.println("Got user session: " + userSess.getSessionId());
1}finally{
2    if((userSm != null) && (userSess != null)){
3        userSm.release(userSess);
4    }
5 
6    if((sessMgr != null) && (superUserSession != null)){
7        sessMgr.release(superUserSession);
8    }
9}

That’s all!!!

Huseyin OZVEREN

Leave a Reply

Your email address will not be published.

Time limit is exhausted. Please reload CAPTCHA.

Related Post