use of org.apache.jackrabbit.oak.spi.security.authentication.AuthInfoImpl in project jackrabbit-oak by apache.
the class UserIDTestLoginModule method commit.
@Override
public boolean commit() {
if (!subject.isReadOnly()) {
// be defensive: remove all potentially added "AuthInfo' objects.
Set<AuthInfo> ais = subject.getPublicCredentials(AuthInfo.class);
if (!ais.isEmpty()) {
subject.getPublicCredentials().removeAll(ais);
}
// and finally add the one that produces the desired result:
String userID = null;
subject.getPublicCredentials().add(new AuthInfoImpl(userID, Collections.<String, Object>emptyMap(), Collections.<Principal>emptySet()));
return true;
} else {
return false;
}
}
Aggregations