@Test public void testGetRememberedPrincipalsWithEmptySerializedBytes() { AbstractRememberMeManager rmm = new DummyRememberMeManager(); PrincipalCollection principals = rmm.getRememberedPrincipals(new DefaultSubjectContext()); assertNull(principals); rmm = new DummyRememberMeManager() { @Override protected byte[] getRememberedSerializedIdentity(SubjectContext subjectContext) { return null; } }; principals = rmm.getRememberedPrincipals(new DefaultSubjectContext()); assertNull(principals); }
public PrincipalCollection getRememberedPrincipals(SubjectContext subjectContext) { PrincipalCollection principals = null; byte[] bytes = null; try { bytes = getRememberedSerializedIdentity(subjectContext); if (bytes != null && bytes.length > 0) { principals = convertBytesToPrincipals(bytes, subjectContext); } } catch (RuntimeException re) { principals = onRememberedPrincipalFailure(re, subjectContext); } finally { ByteUtils.wipe(bytes); } return principals; }
AbstractRememberMeManager implements RememberMeManager { public PrincipalCollection getRememberedPrincipals(SubjectContext subjectContext) { PrincipalCollection principals = null; byte[] bytes = null; try { bytes = getRememberedSerializedIdentity(subjectContext); if (bytes != null && bytes.length > 0) { principals = convertBytesToPrincipals(bytes, subjectContext); } } catch (RuntimeException re) { principals = onRememberedPrincipalFailure(re, subjectContext); } finally { ByteUtils.wipe(bytes); } return principals; } }
AbstractRememberMeManager implements RememberMeManager { public PrincipalCollection getRememberedPrincipals(SubjectContext subjectContext) { PrincipalCollection principals = null; byte[] bytes = null; try { bytes = getRememberedSerializedIdentity(subjectContext); if (bytes != null && bytes.length > 0) { principals = convertBytesToPrincipals(bytes, subjectContext); } } catch (RuntimeException re) { principals = onRememberedPrincipalFailure(re, subjectContext); } finally { ByteUtils.wipe(bytes); } return principals; } AbstractRememberMeManager(); }
AbstractRememberMeManager implements RememberMeManager { public PrincipalCollection getRememberedPrincipals(SubjectContext subjectContext) { PrincipalCollection principals = null; byte[] bytes = null; try { bytes = getRememberedSerializedIdentity(subjectContext); if (bytes != null && bytes.length > 0) { principals = convertBytesToPrincipals(bytes, subjectContext); } } catch (RuntimeException re) { principals = onRememberedPrincipalFailure(re, subjectContext); } finally { ByteUtils.wipe(bytes); } return principals; } AbstractRememberMeManager(); Serializer<PrincipalCollection> getSerializer(); void setSerializer(Serializer<PrincipalCollection> serializer); CipherService getCipherService(); void setCipherService(CipherService cipherService); byte[] getEncryptionCipherKey(); void setEncryptionCipherKey(byte[] encryptionCipherKey); byte[] getDecryptionCipherKey(); void setDecryptionCipherKey(byte[] decryptionCipherKey); byte[] getCipherKey(); void setCipherKey(byte[] cipherKey); void onSuccessfulLogin(Subject subject, AuthenticationToken token, AuthenticationInfo info); void rememberIdentity(Subject subject, AuthenticationToken token, AuthenticationInfo authcInfo); PrincipalCollection getRememberedPrincipals(SubjectContext subjectContext); void onFailedLogin(Subject subject, AuthenticationToken token, AuthenticationException ae); void onLogout(Subject subject); }
AbstractRememberMeManager implements RememberMeManager { public PrincipalCollection getRememberedPrincipals(SubjectContext subjectContext) { PrincipalCollection principals = null; byte[] bytes = null; try { bytes = getRememberedSerializedIdentity(subjectContext); if (bytes != null && bytes.length > 0) { principals = convertBytesToPrincipals(bytes, subjectContext); } } catch (RuntimeException re) { principals = onRememberedPrincipalFailure(re, subjectContext); } finally { ByteUtils.wipe(bytes); } return principals; } AbstractRememberMeManager(); Serializer<PrincipalCollection> getSerializer(); void setSerializer(Serializer<PrincipalCollection> serializer); CipherService getCipherService(); void setCipherService(CipherService cipherService); byte[] getEncryptionCipherKey(); void setEncryptionCipherKey(byte[] encryptionCipherKey); byte[] getDecryptionCipherKey(); void setDecryptionCipherKey(byte[] decryptionCipherKey); byte[] getCipherKey(); void setCipherKey(byte[] cipherKey); void onSuccessfulLogin(Subject subject, AuthenticationToken token, AuthenticationInfo info); void rememberIdentity(Subject subject, AuthenticationToken token, AuthenticationInfo authcInfo); PrincipalCollection getRememberedPrincipals(SubjectContext subjectContext); void onFailedLogin(Subject subject, AuthenticationToken token, AuthenticationException ae); void onLogout(Subject subject);  }