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

API>getlogin,c,ozveren1
...
DM_TICKET=T0JKIE5VTEwgMAoxMwp2ZXJzaW9uIElOVCBTIDA[...]vY3RnRmc9PQo=
API> quit
Bye

 
DFC programming

String superUser = "dmadmin";
String superUserPassword = "dmadmin";
String repoName = "mydocbase";
String username = "hozveren1";

IDfSessionManager sessMgr = null;
IDfSession superUserSession = null;

IDfSessionManager userSm = null;
IDfSession userSess = null;

try{        
// ----- SUPER USER --- Creates a new session manager instance.
{
	IDfClientX clientX = new DfClientX();
	IDfClient localClient = clientX.getLocalClient();
	sessMgr = localClient.newSessionManager();
}
// Adds a new identity to the session manager.
{
	IDfClientX clientX = new DfClientX();
	IDfLoginInfo li = clientX.getLoginInfo();
	li.setUser(superUser);
	li.setPassword(superUserPassword);
	// check if session manager already has an identity. if yes, remove it.
	if (sessMgr.hasIdentity(repoName)){
		sessMgr.clearIdentity(repoName);
	}
	sessMgr.setIdentity(repoName, li);
}

// ----- GENERATION of USER TICKET
superUserSession = sessMgr.getSession(repoName);
String userTicket = superUserSession.getLoginTicketForUser(username);
System.out.println("User ticket: " + userTicket);

        
// ----- USER TICKET --- Creates a new session manager instance.
{
	IDfClientX clientX = new DfClientX();
	IDfClient localClient = clientX.getLocalClient();
	userSm = localClient.newSessionManager();
}
// Adds a new identity to the session manager.
{
	IDfClientX clientX = new DfClientX();
	IDfLoginInfo li = clientX.getLoginInfo();
	li.setUser(username);
	li.setPassword(userTicket);
	// check if session manager already has an identity. if yes, remove it.
	if (userSm.hasIdentity(repoName)){
		userSm.clearIdentity(repoName);
	}
	sm.setIdentity(repoName, li);
}

userSess = userSm.getSession(repoName);
System.out.println("Got user session: " + userSess.getSessionId());

}finally{
	if((userSm != null) && (userSess != null)){
		userSm.release(userSess);
	}

	if((sessMgr != null) && (superUserSession != null)){
		sessMgr.release(superUserSession);
	}
}

That’s all!!!

Huseyin OZVEREN

Leave a Reply

Your email address will not be published.

Time limit is exhausted. Please reload CAPTCHA.

Related Post