diff --git a/dspace-api/src/main/java/org/dspace/authenticate/OidcAuthenticationBean.java b/dspace-api/src/main/java/org/dspace/authenticate/OidcAuthenticationBean.java index fb7b4a92af..41b40066b3 100644 --- a/dspace-api/src/main/java/org/dspace/authenticate/OidcAuthenticationBean.java +++ b/dspace-api/src/main/java/org/dspace/authenticate/OidcAuthenticationBean.java @@ -137,8 +137,12 @@ public class OidcAuthenticationBean implements AuthenticationMethod { return ePerson.canLogIn() ? logInEPerson(context, ePerson) : BAD_ARGS; } - LOGGER.warn("Self registration is currently disabled for OIDC, and no ePerson could be found for email: {}", - email); + // if self registration is disabled, warn about this failure to find a matching eperson + if (! canSelfRegister()) { + LOGGER.warn("Self registration is currently disabled for OIDC, and no ePerson could be found for email: {}", + email); + } + return canSelfRegister() ? registerNewEPerson(context, userInfo, email) : NO_SUCH_USER; } diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/OidcRestController.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/OidcRestController.java index e67d026d80..ab34a72a8d 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/OidcRestController.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/OidcRestController.java @@ -67,7 +67,7 @@ public class OidcRestController { if (StringUtils.equalsAnyIgnoreCase(redirectHostName, allowedHostNames.toArray(new String[0]))) { log.debug("OIDC redirecting to " + redirectUrl); - response.sendRedirect(redirectUrl); + response.sendRedirect(redirectUrl); // lgtm [java/unvalidated-url-redirection] } else { log.error("Invalid OIDC redirectURL=" + redirectUrl + ". URL doesn't match hostname of server or UI!"); diff --git a/dspace/config/modules/authentication.cfg b/dspace/config/modules/authentication.cfg index 7cc6a13b35..df07f91533 100644 --- a/dspace/config/modules/authentication.cfg +++ b/dspace/config/modules/authentication.cfg @@ -24,9 +24,6 @@ # * X.509 Certificate Authentication # Plugin class: org.dspace.authenticate.X509Authentication # Configuration file: authentication-x509.cfg -# * ORCID Authentication -# Plugin class: org.dspace.authenticate.OrcidAuthentication -# Configuration file: authentication-orcid.cfg # * OIDC Authentication # Plugin class: org.dspace.authenticate.OidcAuthentication # Configuration file: authentication-oidc.cfg @@ -52,9 +49,6 @@ # X.509 certificate authentication. See authentication-x509.cfg for default configuration. #plugin.sequence.org.dspace.authenticate.AuthenticationMethod = org.dspace.authenticate.X509Authentication -# ORCID authentication. See authentication-orcid.cfg for default configuration. -#plugin.sequence.org.dspace.authenticate.AuthenticationMethod = org.dspace.authenticate.OrcidAuthentication - # OIDC authentication. See authentication-oidc.cfg for default configuration. #plugin.sequence.org.dspace.authenticate.AuthenticationMethod = org.dspace.authenticate.OidcAuthentication