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

@ -605,16 +605,20 @@ public class OIDCIdentityProvider extends AbstractOAuth2IdentityProvider<OIDCIde
String requestedIssuer = params.getFirst(OAuth2Constants.SUBJECT_ISSUER); String requestedIssuer = params.getFirst(OAuth2Constants.SUBJECT_ISSUER);
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 trustedIssuers = getConfig().getIssuer();
String[] issuers = getConfig().getIssuer().split(","); if (trustedIssuers != null && trustedIssuers.length() > 0) {
String[] issuers = trustedIssuers.split(",");
for (String trustedIssuer : issuers) { for (String trustedIssuer : issuers) {
if (requestedIssuer.equals(trustedIssuer.trim())) { if (requestedIssuer.equals(trustedIssuer.trim())) {
return true; return true;
}
} }
} }
return false; return false;
} }
protected boolean supportsExternalExchange() { protected boolean supportsExternalExchange() {