This is the simplest possible implementation of the {@link OGUser} interface.
This class is mutable and not thread-safe. It is intended to be used in the engine via the read-only {@code OGUser} interface.
2425262728293031323334
public void test_roundTripPasswordHash() { String simple = "P455w0rD"; String hash = AuthenticationUtils.generatePasswordHash(simple); assertNotNull(hash); assertFalse(hash.isEmpty()); SimpleOGUser oguser = new SimpleOGUser("testuser"); oguser.setPasswordHash(hash); assertTrue(AuthenticationUtils.passwordsMatch(oguser, simple)); assertFalse(AuthenticationUtils.passwordsMatch(oguser, "Pa55w0rD")); }
209210211212213214215216217218219220
} protected OGUser getOGUser(String userId) { if (getUserSource() == null) { // Nothing will work without an OG User. So we return a mock one. SimpleOGUser simpleUser = new SimpleOGUser(userId); simpleUser.getEntitlements().add("*"); return simpleUser; } try { return getUserSource().getUser(userId, VersionCorrection.LATEST);