Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Starting RCP with a cmd-line parameter?
Starting RCP with a cmd-line parameter? [message #447544] Mon, 10 April 2006 13:55 Go to next message
Eclipse UserFriend
Originally posted by: nico.bruehl.siemens.com

Hi :)

I am trying to implement an auto_login function in my application and therefore I need to store the password of the user.
To leave the security issue to the user, I would like to implement something like a parameter-listener, so the user can add his/her password to the link of the application.

Something similiar to the eclipse parameters e.g.: C:\eclipse\eclipse.exe -vmargs -Xms256m -Xmx256m -XX:PermSize=64m -XX:MaxPermSize=64m

so in my case it should be something like:
C:\myRCPApp\myRCPApp.exe -userpassword

The question is now, if the programm gets started with this parameter, how can I access this parameter from my RCP by code? Is it even possible?

Thank you in advance :)

Nico
Re: Starting RCP with a cmd-line parameter? [message #447545 is a reply to message #447544] Mon, 10 April 2006 14:17 Go to previous messageGo to next message
Alex Blewitt is currently offline Alex BlewittFriend
Messages: 946
Registered: July 2009
Senior Member
Yes, it's possible, but you'd be better off with using the authorization service from the Platform object.

http://help.eclipse.org/help31/topic/org.eclipse.platform.do c.isv/reference/api/org/eclipse/core/runtime/Platform.html

You can obtain authorisation info for a given URL and add it into it at runtime, instead of at the command line. This encrypts the password (badly) into an .eclipse_keyring file.

Having a password on the command line means that it's trivial to see it via doing a 'ps' or similar.

However, RCP applications do use it; but I'm not sure how. Refresh is understood by org.eclipse.core.resources, for example; I'd expect that it might be triggered by a bundle activator in the resources plugin; you could have a look there.

Alex
Re: Starting RCP with a cmd-line parameter? [message #447546 is a reply to message #447545] Mon, 10 April 2006 14:23 Go to previous messageGo to next message
Alex Blewitt is currently offline Alex BlewittFriend
Messages: 946
Registered: July 2009
Senior Member
In fact, that's pretty much what it does:

protected boolean refreshRequested() {
  String[] args = Platform.getCommandLineArgs();
  for (int i = 0; i < args.length; i++)
  if (args[i].equalsIgnoreCase(REFRESH_ON_STARTUP))
    return true;
  return false;
}


It's even in the same file that I gave you the link to earlier :-) I knew it was somewhere ...
Re: Starting RCP with a cmd-line parameter? [message #447547 is a reply to message #447545] Mon, 10 April 2006 14:24 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: nico.bruehl.siemens.com

thanks;) I will take a closer look at both, the bundle activator and the platform thingy.

I know that the command line password is unsecure :P - I wouldn't use it hehe but they asked for it so I'm trying to implement it.
In general the user shouldn't use the autologin but the normal login dialog.

anyways, I will take a closer look at the mentioned classes, thanks :)

Nico
Re: Starting RCP with a cmd-line parameter? [message #447548 is a reply to message #447546] Mon, 10 April 2006 14:25 Go to previous message
Eclipse UserFriend
Originally posted by: nico.bruehl.siemens.com

wow, that was fast hehe,

THANKS :)
Previous Topic:Help with design decision needed
Next Topic:Automatic update: Should I use UpdateUtils.downloadFeatureContent()
Goto Forum:
  


Current Time: Fri Dec 06 16:44:35 GMT 2024

Powered by FUDForum. Page generated in 0.04130 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top