KEYCLOAK-14655 Check issuer config exists

This commit is contained in:
Pete Cracknell 2020-07-02 23:40:42 +01:00 committed by Hynek Mlnařík
parent 9c4da9b3ce
commit 2ec572e9b5

View file

@ -606,15 +606,19 @@ public class OIDCIdentityProvider extends AbstractOAuth2IdentityProvider<OIDCIde
if (requestedIssuer == null) requestedIssuer = issuer; if (requestedIssuer == null) requestedIssuer = issuer;
if (requestedIssuer.equals(getConfig().getAlias())) return true; if (requestedIssuer.equals(getConfig().getAlias())) return true;
String[] issuers = getConfig().getIssuer().split(","); String trustedIssuers = getConfig().getIssuer();
for (String trustedIssuer : issuers) { if (trustedIssuers != null && trustedIssuers.length() > 0) {
if (requestedIssuer.equals(trustedIssuer.trim())) { String[] issuers = trustedIssuers.split(",");
return true;
for (String trustedIssuer : issuers) {
if (requestedIssuer.equals(trustedIssuer.trim())) {
return true;
}
} }
} }
return false;
return false;
} }
protected boolean supportsExternalExchange() { protected boolean supportsExternalExchange() {