public JAASAuthenticationManager( final SubjectPropertiesProvider propertiesProvider,
final String realm,
final RolesMode mode ) {
super( new JAASAuthenticationSource(),
new BasicUserPassAuthenticationScheme(),
null,
propertiesProvider,
new HashMap<String, String>() {{
if ( realm != null ) {
put( AUTH_DOMAIN_KEY, realm );