WebStorm 2016.3 PasswordSafeImpl method broken

Answered

With the latest WebStorm 2016.3 update, the following plugin code is giving me a java.lang.NoSuchMethodError

PasswordSafeImpl passwordSafe = (PasswordSafeImpl)PasswordSafe.getInstance();

var myPassword = passwordSafe.getMasterKeyProvider().getPassword(....)

I see that it looks like this is now CredentialStore? Do you have an example of implementing this?

For some context, I was using the password safe to save per project user/pass settings for a plugin. The original thread where I was figuring this out is below:

https://intellij-support.jetbrains.com/hc/en-us/community/posts/207218625-Login-Password-Management

Update:

I believe I have this working now:

// Saving
CredentialAttributes attributes = new CredentialAttributes("somekeyforstoring..ex:projectname", "username", this.getClass(), false);
Credentials saveCredentials = new Credentials(attributes.getUserName(), "password");
PasswordSafe.getInstance().set(attributes, saveCredentials);

// Retrieving
CredentialAttributes attributes = new CredentialAttributes("somekeyforstring..ex:projectname", "username", this.getClass(), false);
return PasswordSafe.getInstance().getPassword(attributes);

 

Also for future things like this, where can I see what is being deprecated? 

0

Please sign in to leave a comment.