@Override public Credential getCredential(final String credentialName) throws RealmUnavailableException { for (QueryConfiguration configuration : JdbcSecurityRealm.this.queryConfiguration) { for (KeyMapper keyMapper : configuration.getColumnMappers(KeyMapper.class)) { if (keyMapper.getCredentialName().equals(credentialName)) { return executePrincipalQuery(configuration, resultSet -> keyMapper.map(resultSet)); } } } return null; }
@Override public SupportLevel getCredentialAcquireSupport(final String credentialName) throws RealmUnavailableException { for (QueryConfiguration configuration : JdbcSecurityRealm.this.queryConfiguration) { for (KeyMapper keyMapper : configuration.getColumnMappers(KeyMapper.class)) { if (keyMapper.getCredentialName().equals(credentialName)) { return executePrincipalQuery(configuration, keyMapper::getCredentialSupport); } } } return SupportLevel.UNSUPPORTED; }
@Override public SupportLevel getCredentialAcquireSupport(String credentialName) throws RealmUnavailableException { for (QueryConfiguration configuration : this.queryConfiguration) { for (KeyMapper keyMapper : configuration.getColumnMappers(KeyMapper.class)) { if (keyMapper.getCredentialName().equals(credentialName)) { // by default, all credential types are supported if they have a corresponding mapper. // however, we don't know if an account or realm identity has a specific credential or // not. return SupportLevel.POSSIBLY_SUPPORTED; } } } return SupportLevel.UNSUPPORTED; }