loginModule.initialize(subject, null, sharedState, getAllOptions());
// Simlulate that a previous LM stored a security token in the shared state.
loginModule.setSharedToken(token);
// Simulate Phase 1
assertTrue(loginModule.login());
// Simulate Phase 2
assertTrue(loginModule.commit());
final Set<SamlCredential> samlCredentials = subject.<SamlCredential> getPublicCredentials(SamlCredential.class);