Search in sources :

Example 1 with GenericPasswordManagerModule

use of cz.metacentrum.perun.core.impl.modules.pwdmgr.GenericPasswordManagerModule in project perun by CESNET.

the class UsersManagerBlImpl method getPasswordManagerModule.

@Override
public PasswordManagerModule getPasswordManagerModule(PerunSession session, String namespace) {
    PasswordManagerModule module = getUsersManagerImpl().getPasswordManagerModule(session, namespace);
    if (module == null) {
        log.info("Password manager module for '{}' not found. Loading 'generic' password manager module instead.", namespace);
        module = getUsersManagerImpl().getPasswordManagerModule(session, "generic");
        if (module instanceof GenericPasswordManagerModule) {
            // set proper login-namespace to the generic module
            ((GenericPasswordManagerModule) module).setActualLoginNamespace(namespace);
        }
    }
    if (module == null) {
        log.error("No password manager module found by the class loader for both '{}' and 'generic' namespaces.", namespace);
        throw new InternalErrorException("No password manager module implementation found by the class loader for both '" + namespace + "' and 'generic' namespaces.");
    }
    return module;
}
Also used : PasswordManagerModule(cz.metacentrum.perun.core.implApi.modules.pwdmgr.PasswordManagerModule) GenericPasswordManagerModule(cz.metacentrum.perun.core.impl.modules.pwdmgr.GenericPasswordManagerModule) InternalErrorException(cz.metacentrum.perun.core.api.exceptions.InternalErrorException) GenericPasswordManagerModule(cz.metacentrum.perun.core.impl.modules.pwdmgr.GenericPasswordManagerModule)

Aggregations

InternalErrorException (cz.metacentrum.perun.core.api.exceptions.InternalErrorException)1 GenericPasswordManagerModule (cz.metacentrum.perun.core.impl.modules.pwdmgr.GenericPasswordManagerModule)1 PasswordManagerModule (cz.metacentrum.perun.core.implApi.modules.pwdmgr.PasswordManagerModule)1