Author: rob.stryker(a)jboss.com
Date: 2012-03-28 06:07:43 -0400 (Wed, 28 Mar 2012)
New Revision: 39862
Added:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/OpenshiftUIMessages.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/OpenshiftUIMessages.properties
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.egit.core/src/org/jboss/tools/openshift/egit/core/EGitUtils.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServerUtils.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/console/UserModel.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressDetailsComposite.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressWizardFragment.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ConnectToOpenShiftWizardModel.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPage.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPageModel.java
Log:
/JBIDE-11194 to trunk (password store for new openshift server)
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.egit.core/src/org/jboss/tools/openshift/egit/core/EGitUtils.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.egit.core/src/org/jboss/tools/openshift/egit/core/EGitUtils.java 2012-03-28
09:47:45 UTC (rev 39861)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.egit.core/src/org/jboss/tools/openshift/egit/core/EGitUtils.java 2012-03-28
10:07:43 UTC (rev 39862)
@@ -882,19 +882,22 @@
return hasChanges;
}
- public static int countCommitableChanges(IProject project, IServer server,
IProgressMonitor monitor) {
+ public static int countCommitableChanges(IProject project, IServer server,
IProgressMonitor monitor) throws CoreException {
try {
- Set<String> commitable = getCommitableChanges(project, server, monitor);
+ Repository repo = getRepository(project);
+ if( repo == null ) {
+ throw new CoreException(new Status(IStatus.ERROR, EGitCoreActivator.PLUGIN_ID,
"Project " + project + " has no repository associated with it."));
+ }
+ Set<String> commitable = getCommitableChanges(repo, server, monitor);
return commitable.size();
} catch (IOException ioe) {
+ throw new CoreException(new Status(IStatus.ERROR, EGitCoreActivator.PLUGIN_ID,
"Unable to count commitable resources", ioe));
}
- return -1;
}
- private static Set<String> getCommitableChanges(IProject project, IServer server,
IProgressMonitor monitor)
+ private static Set<String> getCommitableChanges(Repository repo, IServer server,
IProgressMonitor monitor)
throws IOException {
- Repository repo = getRepository(project);
-
+
EclipseGitProgressTransformer jgitMonitor = new
EclipseGitProgressTransformer(monitor);
IndexDiff indexDiff = new IndexDiff(repo, Constants.HEAD,
IteratorService.createInitialIterator(repo));
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServerUtils.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServerUtils.java 2012-03-28
09:47:45 UTC (rev 39861)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServerUtils.java 2012-03-28
10:07:43 UTC (rev 39862)
@@ -41,6 +41,7 @@
import
org.jboss.tools.openshift.express.internal.ui.wizard.IOpenShiftExpressWizardModel;
import com.openshift.express.client.IApplication;
+import com.openshift.express.client.IDomain;
import com.openshift.express.client.IUser;
import com.openshift.express.client.OpenShiftException;
@@ -172,12 +173,12 @@
}
public static void fillServerWithOpenShiftDetails(IServerWorkingCopy wc, IApplication
application,
- UserDelegate user, String mode, String deployProject,
+ UserDelegate user, IDomain domain, String mode, String deployProject,
String projectRelativeFolder, String remoteName) throws OpenShiftException {
fillServerWithOpenShiftDetails(wc,
application == null ? null : application.getApplicationUrl(),
user == null ? null : user.getRhlogin(),
- user == null ? null : user.getDomain().getNamespace(),
+ domain == null ? null : domain.getNamespace(),
application == null ? null : application.getName(),
application == null ? null : application.getUUID(),
deployProject, projectRelativeFolder, mode, remoteName);
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/console/UserModel.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/console/UserModel.java 2012-03-28
09:47:45 UTC (rev 39861)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/console/UserModel.java 2012-03-28
10:07:43 UTC (rev 39862)
@@ -237,6 +237,17 @@
}
}
+ public void clearPasswordInSecureStorage(final String rhLogin) {
+ SecurePasswordStore store = getSecureStore(rhLogin);
+ if (store != null && rhLogin != null && !rhLogin.isEmpty()) {
+ try {
+ store.remove();
+ } catch (SecurePasswordStoreException e) {
+ Logger.error(e.getMessage(), e);
+ }
+ }
+ }
+
private SecurePasswordStore getSecureStore(final String rhLogin) {
return getSecureStore(initLibraServer(), rhLogin);
}
Added:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/OpenshiftUIMessages.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/OpenshiftUIMessages.java
(rev 0)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/OpenshiftUIMessages.java 2012-03-28
10:07:43 UTC (rev 39862)
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.openshift.express.internal.ui;
+
+import org.eclipse.osgi.util.NLS;
+
+public class OpenshiftUIMessages extends NLS {
+ private static final String BUNDLE_NAME =
"org.jboss.tools.openshift.express.internal.ui.OpenshiftUIMessages";
//$NON-NLS-1$
+ static {
+ NLS.initializeMessages(BUNDLE_NAME, OpenshiftUIMessages.class);
+ }
+ private OpenshiftUIMessages() {
+ }
+
+ public static String OpenshiftWizardSavePassword;
+
+
+
+
+
+}
Added:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/OpenshiftUIMessages.properties
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/OpenshiftUIMessages.properties
(rev 0)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/OpenshiftUIMessages.properties 2012-03-28
10:07:43 UTC (rev 39862)
@@ -0,0 +1 @@
+OpenshiftWizardSavePassword=Save password (could trigger secure storage login)
\ No newline at end of file
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressDetailsComposite.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressDetailsComposite.java 2012-03-28
09:47:45 UTC (rev 39861)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressDetailsComposite.java 2012-03-28
10:07:43 UTC (rev 39862)
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.jboss.tools.openshift.express.internal.ui.behaviour;
+import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
@@ -61,12 +62,15 @@
import org.jboss.tools.openshift.express.internal.core.console.UserDelegate;
import org.jboss.tools.openshift.express.internal.core.console.UserModel;
import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
+import org.jboss.tools.openshift.express.internal.ui.OpenshiftUIMessages;
import
org.jboss.tools.openshift.express.internal.ui.wizard.ConnectToOpenShiftWizardModel;
import org.jboss.tools.openshift.express.internal.ui.wizard.CredentialsWizardPageModel;
import
org.jboss.tools.openshift.express.internal.ui.wizard.ImportOpenShiftExpressApplicationWizard;
import
org.jboss.tools.openshift.express.internal.ui.wizard.OpenShiftExpressApplicationWizard;
import com.openshift.express.client.IApplication;
+import com.openshift.express.client.IDomain;
+import com.openshift.express.client.NotFoundOpenShiftException;
import com.openshift.express.client.OpenShiftException;
/**
@@ -86,13 +90,15 @@
protected Text passText;
protected Text deployFolderText;
protected Combo appNameCombo, deployProjectCombo;
- protected Button verifyButton, browseDestButton;
+ protected Button verifyButton, browseDestButton, rememberPasswordCheckBox;
+ protected boolean showVerify, showImportLink;
// Data / Model
- protected boolean showVerify, showImportLink;
+ private boolean rememberPassword = true;
private String user, pass, app, remote, deployProject, deployFolder;
private IApplication fapplication;
private UserDelegate fuser;
+ private IDomain fdomain;
private List<IApplication> appList;
private String[] appListNames;
private IServerWorkingCopy server;
@@ -100,7 +106,6 @@
private HashMap<IApplication, IProject[]> projectsPerApp = new
HashMap<IApplication, IProject[]>();
private boolean credentialsFailed = false;
-
public ExpressDetailsComposite(Composite fill, IServerModeUICallback callback, String
mode, boolean showVerify) {
this.callback = callback;
this.server = callback.getServer();
@@ -169,9 +174,12 @@
userText.setText(user);
userText.setEnabled(showVerify);
}
- if (showVerify && pass != null) {
- passText.setText(pass);
- passText.setEnabled(fapplication == null);
+ if( showVerify ) {
+ if (pass != null) {
+ passText.setText(pass);
+ passText.setEnabled(fapplication == null);
+ }
+ rememberPasswordCheckBox.setSelection(rememberPassword);
}
if (remote != null)
remoteText.setText(remote);
@@ -229,8 +237,12 @@
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true,
false).applyTo(passText);
verifyButton = new Button(composite, SWT.PUSH);
verifyButton.setText("Verify...");
- new Composite(composite, SWT.NULL); // Stub, fill the empty space
+
+ // Add label to check for password remember
+ rememberPasswordCheckBox = new Button(composite, SWT.CHECK);
+ rememberPasswordCheckBox.setText(OpenshiftUIMessages.OpenshiftWizardSavePassword);
}
+
Label appNameLabel = new Label(composite, SWT.NONE);
GridDataFactory.fillDefaults()
.align(SWT.LEFT, SWT.CENTER).applyTo(appNameLabel);
@@ -365,12 +377,14 @@
});
}
if (showVerify) {
- verifyButton.addSelectionListener(new SelectionListener() {
+ verifyButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
verifyPressed();
}
-
- public void widgetDefaultSelected(SelectionEvent e) {
+ });
+ rememberPasswordCheckBox.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ rememberPassword = rememberPasswordCheckBox.getSelection();
}
});
}
@@ -461,31 +475,36 @@
callback.setErrorMessage(getErrorString());
}
- private String getErrorString() {
+ public String getErrorString() {
String error = null;
if( credentialsFailed ) {
error = "Credentials Failed";
+ } else if( appList == null ) {
+ error = "Please click \"verify\" to test your credentials.";
+ } else if( fdomain == null ) {
+ error = "Your OpenShift Express account has not been configured with a
domain.";
+ } else if( app == null || app.equals("")) {
+ error = "Please select an application from the combo below.";
} else {
- if( appList == null ) {
- error = "Please click \"verify\" to test your credentials.";
+ IProject[] p = ExpressServerUtils.findProjectsForApplication(fapplication);
+ if (p == null || p.length == 0) {
+ error = "Your workspace does not have a project corresponding to " + app +
". Please import one.";
}
- else if( app == null || app.equals("")) {
- error = "Please select an application from the combo below.";
- } else {
- IProject[] p = ExpressServerUtils.findProjectsForApplication(fapplication);
- if (p == null || p.length == 0) {
- error = "Your workspace does not have a project corresponding to " + app +
". Please import one.";
- }
- }
}
return error;
}
private Runnable getVerifyingCredentialsJob() {
- final ConnectToOpenShiftWizardModel inner = new ConnectToOpenShiftWizardModel();
+ final ConnectToOpenShiftWizardModel inner = new ConnectToOpenShiftWizardModel() {
+ public UserDelegate setUser(UserDelegate user) {
+ created = user;
+ return user;
+ }
+ };
final CredentialsWizardPageModel model = new CredentialsWizardPageModel(inner);
model.setPassword(pass);
model.setRhLogin(user);
+ model.setRememberPassword(false);
return new Runnable() {
public void run() {
final IStatus s = model.validateCredentials();
@@ -495,8 +514,9 @@
credentialsFailed = false;
try {
updateModelForNewUser(inner.getUser());
+ } catch(NotFoundOpenShiftException nose) {
+ // Ignore this. It will be handled later
} catch(OpenShiftException ose) {
- callback.setErrorMessage(ose.getMessage());
}
}
}
@@ -504,10 +524,18 @@
}
private void updateModelForNewUser(UserDelegate user) throws OpenShiftException {
-
+
// Updating the model, some long-running
projectsPerApp.clear();
- this.appList = user.getApplications();
+ try {
+ // IF we load the applications first, domain gets loaded automatically
+ this.appList = user.getApplications();
+ fdomain = user.getDomain();
+ } catch(NotFoundOpenShiftException nfose) {
+ // Credentials work, but no domain, so no applications either
+ this.appList = new ArrayList<IApplication>();
+ fdomain = null;
+ }
String[] appNames = getAppNamesAsStrings(appList);
int index = Arrays.asList(appNames).indexOf(app);
IApplication application = index == -1 ? null : appList.get(index);
@@ -530,6 +558,11 @@
public void finish(IProgressMonitor monitor) throws CoreException {
try {
UserModel.getDefault().addUser(fuser);
+ if( rememberPassword ) {
+ UserModel.getDefault().setPasswordInSecureStorage(fuser.getRhlogin(),
fuser.getPassword());
+ } else {
+ UserModel.getDefault().clearPasswordInSecureStorage(fuser.getRhlogin());
+ }
fillServerWithDetails();
} catch(OpenShiftException ose) {
throw new CoreException(new Status(IStatus.ERROR, OpenShiftUIActivator.PLUGIN_ID,
ose.getMessage(), ose));
@@ -540,7 +573,7 @@
// update the values
IServerWorkingCopy wc = callback.getServer();
ExpressServerUtils.fillServerWithOpenShiftDetails(wc, fapplication,
- fuser, mode, deployProject, deployFolder, remote);
+ fuser, fdomain, mode, deployProject, deployFolder, remote);
}
private String[] getAppNamesAsStrings(List<IApplication> allApps) {
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressWizardFragment.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressWizardFragment.java 2012-03-28
09:47:45 UTC (rev 39861)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressWizardFragment.java 2012-03-28
10:07:43 UTC (rev 39862)
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.jboss.tools.openshift.express.internal.ui.behaviour;
-import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.jobs.Job;
@@ -25,11 +24,7 @@
import
org.jboss.ide.eclipse.as.ui.editor.DeploymentTypeUIUtil.NewServerWizardBehaviourCallback;
import org.jboss.tools.common.ui.WizardUtils;
import org.jboss.tools.openshift.express.internal.core.behaviour.ExpressServerUtils;
-import org.jboss.tools.openshift.express.internal.core.console.UserDelegate;
-import org.jboss.tools.openshift.express.internal.core.console.UserModel;
-import com.openshift.express.client.IApplication;
-
public class ExpressWizardFragment extends WizardFragment implements ICompletable {
private ExpressDetailsComposite composite;
private NewServerWizardBehaviourCallback callback;
@@ -45,7 +40,7 @@
}
public boolean isComplete() {
- return super.isComplete();
+ return composite.getErrorString() == null;
}
public Composite createComposite(Composite parent, IWizardHandle handle) {
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ConnectToOpenShiftWizardModel.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ConnectToOpenShiftWizardModel.java 2012-03-28
09:47:45 UTC (rev 39861)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ConnectToOpenShiftWizardModel.java 2012-03-28
10:07:43 UTC (rev 39862)
@@ -17,15 +17,16 @@
* @author André Dietisheim
*/
public class ConnectToOpenShiftWizardModel implements IUserAwareModel {
-
+ protected UserDelegate created = null;
@Override
public UserDelegate getUser() {
- return UserModel.getDefault().getRecentUser();
+ return created == null ? UserModel.getDefault().getRecentUser() : created;
}
@Override
public UserDelegate setUser(UserDelegate user) {
UserModel.getDefault().addUser(user);
+ created = user;
return user;
}
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPage.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPage.java 2012-03-28
09:47:45 UTC (rev 39861)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPage.java 2012-03-28
10:07:43 UTC (rev 39862)
@@ -43,6 +43,7 @@
import org.jboss.tools.common.ui.WizardUtils;
import org.jboss.tools.common.ui.databinding.ParametrizableWizardPageSupport;
import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
+import org.jboss.tools.openshift.express.internal.ui.OpenshiftUIMessages;
import org.jboss.tools.openshift.express.internal.ui.utils.Logger;
import org.jboss.tools.openshift.express.internal.ui.utils.StringUtils;
import org.jboss.tools.openshift.express.internal.ui.utils.UIUtils;
@@ -116,7 +117,7 @@
new Label(container, SWT.NONE); // filler to align the checkbox under
// the text fields
Button rememberPasswordCheckBox = new Button(container, SWT.CHECK);
- rememberPasswordCheckBox.setText("Save password (could trigger secure storage
login)");
+ rememberPasswordCheckBox.setText(OpenshiftUIMessages.OpenshiftWizardSavePassword);
GridDataFactory.fillDefaults()
.align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(rememberPasswordCheckBox);
final IObservableValue rememberPasswordModelObservable =
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPageModel.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPageModel.java 2012-03-28
09:47:45 UTC (rev 39861)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPageModel.java 2012-03-28
10:07:43 UTC (rev 39862)
@@ -47,7 +47,6 @@
private IStatus credentialsStatus;
private StringPreferenceValue rhLoginPreferenceValue;
private final String libraServer;
- private SecurePasswordStore store;
private IUserAwareModel wizardModel;
@@ -58,7 +57,6 @@
this.rhLoginPreferenceValue = new StringPreferenceValue(RHLOGIN_PREFS_KEY,
OpenShiftUIActivator.PLUGIN_ID);
this.libraServer = initLibraServer();
this.rhLogin = initRhLogin();
- initSecureStore(libraServer, rhLogin);
this.password = initPassword();
resetCredentialsStatus();
}
@@ -72,11 +70,6 @@
return null;
}
- private void initSecureStore(final String platform, final String rhLogin) {
- this.key = new OpenShiftPasswordStorageKey(platform, rhLogin);
- this.store = new SecurePasswordStore(key);
- }
-
protected String initRhLogin() {
String rhLogin = null;
@@ -100,37 +93,19 @@
protected String initPassword() {
String password = null;
if (!StringUtils.isEmpty(libraServer)
- && !StringUtils.isEmpty(rhLogin)
- && store != null) {
- try {
- password = store.getPassword();
- setRememberPassword(!StringUtils.isEmpty(password));
- } catch (SecurePasswordStoreException e) {
- Logger.error("Could not retrieve user password from Secured Store", e);
- }
+ && !StringUtils.isEmpty(rhLogin)) {
+ password = UserModel.getDefault().getPasswordFromSecureStorage(rhLogin);
+ setRememberPassword(!StringUtils.isEmpty(password));
}
return password;
}
private void storePassword(UserDelegate user) {
- try {
- if (store != null ) {
- OpenShiftPasswordStorageKey key = new OpenShiftPasswordStorageKey(libraServer,
user.getRhlogin());
- store.update(key, password);
- }
- } catch (SecurePasswordStoreException e) {
- Logger.error(e.getMessage(), e);
- }
+ UserModel.getDefault().setPasswordInSecureStorage(user.getRhlogin(), password);
}
private void erasePasswordStore() {
- try {
- if (store != null) {
- store.remove();
- }
- } catch (SecurePasswordStoreException e) {
- Logger.error(e.getMessage(), e);
- }
+ UserModel.getDefault().clearPasswordInSecureStorage(rhLogin);
}
protected String getConfiguredUserName() {