It's all about the answers!

Ask a question

Can you login using scm repositories.txt file using java api


K M (38325051) | asked Aug 06 '10, 12:24 p.m.
Can you login using scm repositories.txt file using java api?

can we pass this line to RTC using the java api?

https://localhost:9443/jazz/,,FRED,idmWThOyq8k=

7 answers



permanent link
Evan Hughes (2.4k1318) | answered Aug 09 '10, 11:17 a.m.
JAZZ DEVELOPER
What's your use case?

Not easily. You could reuse the internals of the commandline interface to get the RepositoryRegistry and extract the record you care about, but that isn't published API so it could change without warning.

permanent link
K M (38325051) | answered Aug 09 '10, 12:08 p.m.
I am using two types of automation one with scm and one with java api.

I would like to use the scm config file repositories.txt file to get the url,user and password for both.

Is it possible??

permanent link
Evan Hughes (2.4k1318) | answered Aug 09 '10, 1:21 p.m.
JAZZ DEVELOPER
I would like to use the scm config file repositories.txt file to get the url,user and password for both.

Is it possible??


In that situation I would store the password in another url/user/pw in another location and run 'scm login' with the at the start of the stuff that involves the CLI.

The repositories.txt file is readable, but it should be considered API. We're likely to change it in future releases.

e

permanent link
K M (38325051) | answered Aug 09 '10, 2:51 p.m.
if I run from the command prompt

scm --config c:\tmp\login login.

you are saying with I run my java script I do not have to run

jdk1.5.0_13\bin\java.exe -Djava.ext.dirs=jdk1.5.0_13\jre\lib\ext;RTC_plainjava_lib;Common\lib;. bdd_update.CmdRequest


repo.login()

I don't think that will work???

permanent link
Evan Hughes (2.4k1318) | answered Aug 09 '10, 3:54 p.m.
JAZZ DEVELOPER
I'm sorry, I don't follow your question.

I suggest that you store the url/username/password in a file of your own.

When you want to run the CLI, you consult that file and run 'scm login' at the start of your script, with the fields set appropriately.

When you want to use the plain java libraries, you get the url/username/password yourself and set them as appropriate.

In other words: don't try and use repositories.txt to store your credentials.

permanent link
K M (38325051) | answered Aug 09 '10, 4:00 p.m.
so I store the password unencrypted or encrypted by me.

basicaly two password file which could be out of sync.....

not a great solution........but if that all that can be done.....I will have to live with it

permanent link
Evan Hughes (2.4k1318) | answered Aug 09 '10, 4:05 p.m.
JAZZ DEVELOPER
So long as you run an 'scm login' with the credentials from your file, there's no risk of being out of sync.

e

Your answer


Register or 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.