Backend API. Server-side code: this runs in a Codename One backend, not in the app on the device.
public final class NoOpPasswordEncoder
- Object
- NoOpPasswordEncoder
ImplementsPasswordEncoder
Stores a password as it is: {noop}secret. For a demonstration or a test,
where the point is to read the password in the source.
It verifies only on a development profile. Anywhere else a {noop} password
matches nothing and the server says why once on standard error, because a
clear-text password that works in production is a configuration left over
from a laptop.
Methods
public static NoOpPasswordEncoder getInstance() | |
public static void setDevelopmentProfile(boolean value) | Says whether this process runs on a development profile. |
public String encode(CharSequence rawPassword) | The password as it should be stored: salted and hashed, so encoding one password twice gives two different results. |
public boolean matches(CharSequence rawPassword, String encodedPassword) | Whether rawPassword is the password encodedPassword was made from. |
Inherited methods
Method details
getInstance
public static NoOpPasswordEncoder getInstance()setDevelopmentProfile
public static void setDevelopmentProfile(boolean value)Says whether this process runs on a development profile. The security
layer calls it from the configuration it is built with; a test that uses
the encoder on its own calls it too.
encode
public String encode(CharSequence rawPassword)The password as it should be stored: salted and hashed, so encoding one
password twice gives two different results.
matches
public boolean matches(CharSequence rawPassword, String encodedPassword)Whether
rawPassword is the password encodedPassword was made from.