Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

How to cache password/authentication when using plainJava API

I have written some plainJava API utilities to allow my department to use a CLI to create, modify and update workitems.  A user might want to add the same comment or tag to multiple work items, however at present the utilities I have written require the user to enter password,userid etc each time the utility is invoked.  Eg:

rtcwi -add 1234 -comments "this is just a dummy comment" -userid fred@acme.com -password xxxx -repository jazz123.acme.com::9443/ccm
rtcwi -add 1235 -comments "this is just a dummy comment" -userid fred@acme.com -password xxxx -repository jazz123.acme.com::9443/ccm
rtcwi -add 1236 -comments "this is just a dummy comment" -userid fred@acme.com -password xxxx -repository jazz123.acme.com::9443/ccm
rtcwi -add 1237 -comments "this is just a dummy comment" -userid fred@acme.com -password xxxx -repository jazz123.acme.com::9443/ccm
etc

where rtcwi is the utility for adding comments to the work item (1234, 1235 etc).   If the user runs this sequence, then each time that rtcwi is invoked, the utility has to do a Team Startup and login to RTC and then do the work and then logout and do a Team Shutdown.

Is there any way to cache the authentication tokens for RTC so that if a user runs something like rtcwi mulitple times from the same host login session say, you don't have to repeat the timeconsuming login process?  I guess lscm does this - is there any example code around to help me copy that method?
many thanks.  Dave Sinclair

0 votes



2 answers

Permanent link

We do it similar to the Build Engine JBE.

We have a special command "-createpwd -filename=file" in our JazzCLI tools, which creates an encrypted password file. And for all other command we have a "-pwdfile=filename" parameter where we can reference the password file. As a special security we do only allow to use the password file on the same machine (hardware-id) where it was generated.

The session is recreated each time we call the command. But because we need this mainly in scheduled jobs, this is not relevant for us.

1 vote


Permanent link
lscm keeps a daemon running that caches the username and password so it can retrieve the connection that was opened in a previous call. I don't believe that the daemon is available for public use so you would have to implement your own way of caching the credentials.

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,927
× 87
× 30

Question asked: Apr 24 '13, 1:28 p.m.

Question was seen: 6,119 times

Last updated: Apr 25 '13, 9:07 a.m.

Related questions
Confirmation Cancel Confirm