Requested changes

- only warn about failure to find a matching ePerson if canSelfRegister
is false
- tell LGTMbot everything is fine with the redirect
- remove comments about nonexistent ORCID login code
This commit is contained in:
Hardy Pottinger
2022-01-27 10:57:54 -06:00
parent b0ce61d3fe
commit ddbaabcbb5
3 changed files with 7 additions and 9 deletions

View File

@@ -137,8 +137,12 @@ public class OidcAuthenticationBean implements AuthenticationMethod {
return ePerson.canLogIn() ? logInEPerson(context, ePerson) : BAD_ARGS; return ePerson.canLogIn() ? logInEPerson(context, ePerson) : BAD_ARGS;
} }
// 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: {}", LOGGER.warn("Self registration is currently disabled for OIDC, and no ePerson could be found for email: {}",
email); email);
}
return canSelfRegister() ? registerNewEPerson(context, userInfo, email) : NO_SUCH_USER; return canSelfRegister() ? registerNewEPerson(context, userInfo, email) : NO_SUCH_USER;
} }

View File

@@ -67,7 +67,7 @@ public class OidcRestController {
if (StringUtils.equalsAnyIgnoreCase(redirectHostName, allowedHostNames.toArray(new String[0]))) { if (StringUtils.equalsAnyIgnoreCase(redirectHostName, allowedHostNames.toArray(new String[0]))) {
log.debug("OIDC redirecting to " + redirectUrl); log.debug("OIDC redirecting to " + redirectUrl);
response.sendRedirect(redirectUrl); response.sendRedirect(redirectUrl); // lgtm [java/unvalidated-url-redirection]
} else { } else {
log.error("Invalid OIDC redirectURL=" + redirectUrl + log.error("Invalid OIDC redirectURL=" + redirectUrl +
". URL doesn't match hostname of server or UI!"); ". URL doesn't match hostname of server or UI!");

View File

@@ -24,9 +24,6 @@
# * X.509 Certificate Authentication # * X.509 Certificate Authentication
# Plugin class: org.dspace.authenticate.X509Authentication # Plugin class: org.dspace.authenticate.X509Authentication
# Configuration file: authentication-x509.cfg # Configuration file: authentication-x509.cfg
# * ORCID Authentication
# Plugin class: org.dspace.authenticate.OrcidAuthentication
# Configuration file: authentication-orcid.cfg
# * OIDC Authentication # * OIDC Authentication
# Plugin class: org.dspace.authenticate.OidcAuthentication # Plugin class: org.dspace.authenticate.OidcAuthentication
# Configuration file: authentication-oidc.cfg # Configuration file: authentication-oidc.cfg
@@ -52,9 +49,6 @@
# X.509 certificate authentication. See authentication-x509.cfg for default configuration. # X.509 certificate authentication. See authentication-x509.cfg for default configuration.
#plugin.sequence.org.dspace.authenticate.AuthenticationMethod = org.dspace.authenticate.X509Authentication #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. # OIDC authentication. See authentication-oidc.cfg for default configuration.
#plugin.sequence.org.dspace.authenticate.AuthenticationMethod = org.dspace.authenticate.OidcAuthentication #plugin.sequence.org.dspace.authenticate.AuthenticationMethod = org.dspace.authenticate.OidcAuthentication