Bug 259070 - Provide secure storage based ICredentialsProvider
Summary: Provide secure storage based ICredentialsProvider
Status: ASSIGNED
Alias: None
Product: EMF
Classification: Modeling
Component: cdo.net4j (show other bugs)
Version: 4.13   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Eike Stepper CLA
QA Contact: Eike Stepper CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-17 04:09 EST by Eike Stepper CLA
Modified: 2020-12-11 10:45 EST (History)
4 users (show)

See Also:


Attachments
Plugin with really first draft (14.60 KB, application/octet-stream)
2010-11-22 17:13 EST, Heiko Ahlig CLA
no flags Details
Patch for IPasswordCredentialsProvider2 (7.44 KB, patch)
2010-11-27 02:57 EST, Eike Stepper CLA
no flags Details | Diff
Patch v2 (12.15 KB, patch)
2010-11-29 12:30 EST, Eike Stepper CLA
no flags Details | Diff
Plugin with a second draft based on Patch v2 (18.77 KB, application/octet-stream)
2010-11-29 17:40 EST, Heiko Ahlig CLA
no flags Details
Patch v4 - complete (38.32 KB, patch)
2010-12-09 06:56 EST, Eike Stepper CLA
no flags Details | Diff
Adjusted Patch (34.36 KB, patch)
2011-05-26 17:53 EDT, Heiko Ahlig CLA
no flags Details | Diff
Patch v6 (35.27 KB, patch)
2011-05-27 17:17 EDT, Heiko Ahlig CLA
no flags Details | Diff
Patch v7 (46.20 KB, patch)
2011-07-16 10:55 EDT, Eike Stepper CLA
no flags Details | Diff
Patch v8 (39.15 KB, patch)
2011-08-25 04:22 EDT, Heiko Ahlig CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eike Stepper CLA 2008-12-17 04:09:32 EST
 
Comment 1 Eike Stepper CLA 2009-11-01 05:57:45 EST
Rebasing all unresolved enhancement requests to 3.0
Comment 2 Eike Stepper CLA 2010-06-29 04:49:48 EDT
Rebasing all outstanding enhancements requests to version 4.0
Comment 3 Heiko Ahlig CLA 2010-11-22 17:13:07 EST
Created attachment 183618 [details]
Plugin with really first draft

Hi,
inside the attachment are a really first draft for a password credential provider, which uses the Equinox Security Storage to persist the user / password
for further times.

Base for it are the current data from cvs.

It is useable on client side with:
String uri = "cdo.net4j.tcp://localhost:2036/gastro";
SecuredInteractiveCredentialsProvider p = new 
SecuredInteractiveCredentialsProvider(uri, null, null);
//alternative you can set an URL and options  for an alternate SecurePreferenceLocation
config.getAuthenticator().setCredentialsProvider(p);

There are many things to do, but for this I want to know, if this the wished functionality.

Feedback is appreciated.

Greetings 
Heiko
Comment 4 Eike Stepper CLA 2010-11-27 02:56:30 EST
Heiko, I reviewed your contribution and have the following comments:

1) In org.eclipse.emf.cdo.ui.security.SecuredCredentialsDialog.createUI(Composite) you're reusing GridData data. Not sure if that's allowed.

2) You're using CDOURIData. That means that the new mechansim does not work for canonical URIs. I wonder if we should only use the repo-UUID/userID as a key into the secure store. Since the connection-aware URIs do not contain the repo-UUID (rather the repo name), we'd need to investigate how we can feed the UUID into the credentials provider. I'll attach a patch that you can try out. It contains an IPasswordCredentialsProvider2 interface that you could use.

3) Can you make the function that determines the preference node from the "realm" more configurable? A protected method would do.

4) There is already a org.eclipse.net4j.util.ui.security.CredentialsDialog. I guess that yours is superior but I'd rather have only one of them. Can you please try to factor out all "secure" dependent code from your dialog ao that we can use it in both places?

Thank you for your effort. I'm sure we can make this a nice contribution ;-)
Comment 5 Eike Stepper CLA 2010-11-27 02:57:41 EST
Created attachment 183974 [details]
Patch for IPasswordCredentialsProvider2

If it turns out that this patch is useful, we should provide an ICredentialsProvider2 as a super interface, as well...
Comment 6 Eike Stepper CLA 2010-11-29 12:30:24 EST
Created attachment 184057 [details]
Patch v2

Fixed repo==null
Comment 7 Heiko Ahlig CLA 2010-11-29 17:40:02 EST
Created attachment 184084 [details]
Plugin with a second draft based on Patch v2

Hi Eike

Regarding point 1 and four of your comments:
I removed my Dialog and makes a copy of the CredentialsDialog and make there some modifications.
If we add the IPasswordCredentialStore to the API, the dialog should be usesable at the normal InteractiveCredentialProvider,too.

Regarding point2 and 3:
I put all function of the secured preferenced in a credential store.

I hope, this version are closer to your ideas.

At the moment I use the realm as first node under the root node of the secured preferences, but I think we should have one more node inside the tree under there are all repositories as nodes.

Feedback is appreciated again. ;)
Comment 8 Heiko Ahlig CLA 2010-11-29 17:48:09 EST
The second draft is usable with:
    SecurePreferencePasswordCredentialStore store = new SecurePreferencePasswordCredentialStore();
    SecuredInteractiveCredentialsProvider p = new SecuredInteractiveCredentialsProvider();
    p.setPasswordCredentialStore(store);
    LifecycleUtil.activate(p);
    config.getAuthenticator().setCredentialsProvider(p);
Comment 9 Eike Stepper CLA 2010-12-09 06:56:32 EST
Created attachment 184845 [details]
Patch v4 - complete

I integrated the new code into the existing plugins and added factories and injectors. Please test...
Comment 10 Heiko Ahlig CLA 2011-05-26 17:53:16 EDT
Created attachment 196707 [details]
Adjusted Patch

Hi Eike,
long time later, I have tested your patch.
I adjust it to the current sources.
For me it looks good and works.
Some time ago, I talked you for a small enhancement,due the nodes inside the security preferences.
There I do a small change at the SecurePreferencePasswordCredentialsStore and the factory, to put a extra node into the tree between root and target/realm node.

At the moment, I define the '#' char as split char, but maybe there are some better char , which would not used inside urls or file names.

Greetings

Heiko
Comment 11 Heiko Ahlig CLA 2011-05-27 17:17:26 EDT
Created attachment 196815 [details]
Patch v6

Some errors inside the generation throug the factory fixed.
Usability inside a net4j client:
IPasswordCredentialsProvider credentialProvider = (IPasswordCredentialsProvider)IPluginContainer.INSTANCE
        .getElement("org.eclipse.net4j.util.security.credentialsProviders", "secure-interactive", <description>);

<description could be:
- null -> no store;
- "secure" -> SecurePreferenceStore with default loaction and node
- "secure,myfileURL" -> SecurePreferenceStore with  file loaction and default node
- "secure,myfileURL#CDORepositories" -> SecurePreferenceStore with file loaction and a visible node named "CDORepository" inside the Secure Storage preference page.
Comment 12 Eike Stepper CLA 2011-06-23 03:56:14 EDT
Moving all open enhancement requests to 4.1
Comment 13 Eike Stepper CLA 2011-07-16 10:54:28 EDT
Heiko, I'm going to submit an IPZilla request (CQ) for this .Please provide contact details for each of the contributors: name, organization, email address and/or phone number, percent of contribution authored.
Comment 14 Eike Stepper CLA 2011-07-16 10:55:49 EDT
Created attachment 199785 [details]
Patch v7

I've adjusted the patch to 4.1 development, breaking changes are not allowed. Please test if it still does what you want.
Comment 15 Heiko Ahlig CLA 2011-08-25 04:06:23 EDT
(In reply to comment #13)
> Heiko, I'm going to submit an IPZilla request (CQ) for this .Please provide
> contact details for each of the contributors:
> name
, organization, email address
> and/or phone number, percent of contribution authored.
Comment 16 Heiko Ahlig CLA 2011-08-25 04:13:43 EDT
(In reply to comment #13)
> Heiko, I'm going to submit an IPZilla request (CQ) for this .Please provide
> contact details for each of the contributors: 
> name,
 Heiko Ahlig,
> organization
 ---,
> email address and/or phone number,
 nacor@gxm.de
>percent of contribution authored.
Confirmed (100%)
Comment 17 Heiko Ahlig CLA 2011-08-25 04:22:05 EDT
Created attachment 202127 [details]
Patch v8

For using the ICredentialProvider and store inside the Eclipse IDE,
You have to be change:
inside: org.eclipse.emf.cdo.internal.net4j.Net4jSessionFactory.java

method: getCredentialsProviderType
"interactive" -> "secure-interactive"

method: getCredentialsProvider
the description parameter
null -> "secure,#CDO-Repositories"
Comment 18 Heiko Ahlig CLA 2011-08-25 04:40:03 EDT
(In reply to comment #16)
> (In reply to comment #13)
> > Heiko, I'm going to submit an IPZilla request (CQ) for this .Please provide
> > contact details for each of the contributors: 
> > name,
>  Heiko Ahlig,
> > organization
>  ---,
> > email address and/or phone number,
>  nacor@gxm.de
nacor@gmx.de
> >percent of contribution authored.
> Confirmed (100%)
Comment 19 Eike Stepper CLA 2012-08-14 22:54:42 EDT
Moving all open issues to 4.2. Open bugs can be ported to 4.1 maintenance after they've been fixed in master.
Comment 20 Eike Stepper CLA 2013-06-27 04:05:01 EDT
Moving all outstanding enhancements to 4.3
Comment 21 Eike Stepper CLA 2014-08-19 09:21:38 EDT
Moving all open enhancement requests to 4.4
Comment 22 Eike Stepper CLA 2014-08-19 09:34:28 EDT
Moving all open enhancement requests to 4.4
Comment 23 Eike Stepper CLA 2015-07-14 02:17:08 EDT
Moving all open bugzillas to 4.5.
Comment 24 Eike Stepper CLA 2016-07-31 01:00:10 EDT
Moving all unaddressed bugzillas to 4.6.
Comment 25 Eike Stepper CLA 2017-12-28 01:10:03 EST
Moving all open bugs to 4.7
Comment 26 Eike Stepper CLA 2019-11-08 02:17:42 EST
Moving all unresolved issues to version 4.8-
Comment 27 Eike Stepper CLA 2019-12-13 12:46:51 EST
Moving all unresolved issues to version 4.9
Comment 28 Eike Stepper CLA 2020-12-11 10:45:20 EST
Moving to 4.13.