diff --git a/cas-server-support-osf/src/main/java/io/cos/cas/adaptors/postgres/handlers/OpenScienceFrameworkAuthenticationHandler.java b/cas-server-support-osf/src/main/java/io/cos/cas/adaptors/postgres/handlers/OpenScienceFrameworkAuthenticationHandler.java
index 90b5c8f1..eea892e1 100644
--- a/cas-server-support-osf/src/main/java/io/cos/cas/adaptors/postgres/handlers/OpenScienceFrameworkAuthenticationHandler.java
+++ b/cas-server-support-osf/src/main/java/io/cos/cas/adaptors/postgres/handlers/OpenScienceFrameworkAuthenticationHandler.java
@@ -22,13 +22,13 @@
import io.cos.cas.adaptors.postgres.models.OpenScienceFrameworkGuid;
import io.cos.cas.adaptors.postgres.models.OpenScienceFrameworkTimeBasedOneTimePassword;
import io.cos.cas.adaptors.postgres.models.OpenScienceFrameworkUser;
+import io.cos.cas.authentication.exceptions.AccountNotConfirmedIdPLoginException;
+import io.cos.cas.authentication.exceptions.AccountNotConfirmedOsfLoginException;
import io.cos.cas.authentication.InvalidVerificationKeyException;
-import io.cos.cas.authentication.LoginNotAllowedException;
import io.cos.cas.authentication.OneTimePasswordFailedLoginException;
import io.cos.cas.authentication.OneTimePasswordRequiredException;
import io.cos.cas.authentication.OpenScienceFrameworkCredential;
import io.cos.cas.authentication.ShouldNotHappenException;
-import io.cos.cas.authentication.exceptions.AccountNotConfirmedIdPLoginException;
import io.cos.cas.authentication.oath.TotpUtils;
import org.jasig.cas.authentication.AccountDisabledException;
@@ -189,7 +189,7 @@ protected final HandlerResult authenticateInternal(final OpenScienceFrameworkCre
// Check user's status, and only ACTIVE user can sign in
if (USER_NOT_CONFIRMED_OSF.equals(userStatus)) {
- throw new LoginNotAllowedException(username + " is registered but not confirmed");
+ throw new AccountNotConfirmedOsfLoginException(username + " is registered but not confirmed");
} else if (USER_NOT_CONFIRMED_IDP.equals(userStatus)) {
throw new AccountNotConfirmedIdPLoginException(username + " is registered via external IdP but not confirmed ");
} else if (USER_DISABLED.equals(userStatus)) {
diff --git a/cas-server-support-osf/src/main/java/io/cos/cas/authentication/LoginNotAllowedException.java b/cas-server-support-osf/src/main/java/io/cos/cas/authentication/exceptions/AccountNotConfirmedOsfLoginException.java
similarity index 72%
rename from cas-server-support-osf/src/main/java/io/cos/cas/authentication/LoginNotAllowedException.java
rename to cas-server-support-osf/src/main/java/io/cos/cas/authentication/exceptions/AccountNotConfirmedOsfLoginException.java
index 2add2e69..7f5d434a 100644
--- a/cas-server-support-osf/src/main/java/io/cos/cas/authentication/LoginNotAllowedException.java
+++ b/cas-server-support-osf/src/main/java/io/cos/cas/authentication/exceptions/AccountNotConfirmedOsfLoginException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015. Center for Open Science
+ * Copyright (c) 2020. Center for Open Science
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,23 +13,23 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package io.cos.cas.authentication;
+package io.cos.cas.authentication.exceptions;
import javax.security.auth.login.AccountException;
/**
- * Describes an error condition where authentication occurs from an registered but not confirmed account.
+ * Describes an error condition where authentication occurs from a registered (via OSF email-password sign-up) but
+ * not confirmed account.
*
- * @author Michael Haselton
* @author Longze Chen
- * @since 4.1.5
+ * @since 20.0.0
*/
-public class LoginNotAllowedException extends AccountException {
+public class AccountNotConfirmedOsfLoginException extends AccountException {
private static final long serialVersionUID = 3376259469680697722L;
/** Instantiates a new exception (default). */
- public LoginNotAllowedException() {
+ public AccountNotConfirmedOsfLoginException() {
super();
}
@@ -38,7 +38,7 @@ public LoginNotAllowedException() {
*
* @param message the message
*/
- public LoginNotAllowedException(final String message) {
+ public AccountNotConfirmedOsfLoginException(final String message) {
super(message);
}
}
diff --git a/cas-server-support-osf/src/main/java/io/cos/cas/web/flow/OpenScienceFrameworkAuthenticationExceptionHandler.java b/cas-server-support-osf/src/main/java/io/cos/cas/web/flow/OpenScienceFrameworkAuthenticationExceptionHandler.java
index e89494b1..9a3eb29a 100644
--- a/cas-server-support-osf/src/main/java/io/cos/cas/web/flow/OpenScienceFrameworkAuthenticationExceptionHandler.java
+++ b/cas-server-support-osf/src/main/java/io/cos/cas/web/flow/OpenScienceFrameworkAuthenticationExceptionHandler.java
@@ -21,11 +21,11 @@
import java.util.Set;
import io.cos.cas.authentication.exceptions.AccountNotConfirmedIdPLoginException;
+import io.cos.cas.authentication.exceptions.AccountNotConfirmedOsfLoginException;
import io.cos.cas.authentication.exceptions.CasClientLoginException;
import io.cos.cas.authentication.exceptions.DelegatedLoginException;
import io.cos.cas.authentication.exceptions.OrcidClientLoginException;
import io.cos.cas.authentication.InvalidVerificationKeyException;
-import io.cos.cas.authentication.LoginNotAllowedException;
import io.cos.cas.authentication.OneTimePasswordFailedLoginException;
import io.cos.cas.authentication.OneTimePasswordRequiredException;
import io.cos.cas.authentication.RemoteUserFailedLoginException;
@@ -52,7 +52,7 @@
*
* @author Michael Haselton
* @author Longze Chen
- * @since 4.1.5
+ * @since 19.0.0
*/
public class OpenScienceFrameworkAuthenticationExceptionHandler extends AuthenticationExceptionHandler {
@@ -81,7 +81,7 @@ public class OpenScienceFrameworkAuthenticationExceptionHandler extends Authenti
// Customized exceptions for OSF
static {
DEFAULT_ERROR_LIST.add(InvalidVerificationKeyException.class);
- DEFAULT_ERROR_LIST.add(LoginNotAllowedException.class);
+ DEFAULT_ERROR_LIST.add(AccountNotConfirmedOsfLoginException.class);
DEFAULT_ERROR_LIST.add(AccountNotConfirmedIdPLoginException.class);
DEFAULT_ERROR_LIST.add(ShouldNotHappenException.class);
DEFAULT_ERROR_LIST.add(RemoteUserFailedLoginException.class);
diff --git a/cas-server-webapp/src/main/resources/messages.properties b/cas-server-webapp/src/main/resources/messages.properties
index 5496732f..3d9c7b03 100644
--- a/cas-server-webapp/src/main/resources/messages.properties
+++ b/cas-server-webapp/src/main/resources/messages.properties
@@ -144,11 +144,11 @@ screen.badworkstation.heading=You cannot login from this workstation.
screen.badworkstation.message=Please contact support@osf.io to regain access.
# OSF Login Failure Pages
-screen.loginnotallowed.heading=Account not confirmed
-screen.loginnotallowed.message=The OSF account associated with the email has been registered but not confirmed. Please check your email (and spam folder) or click the button below to resend your confirmation email.
+screen.accountnotconfirmed.osflogin.heading=Account not confirmed
+screen.accountnotconfirmed.osflogin.message=The OSF account associated with the email has been registered but not confirmed. Please check your email (and spam folder) or click the button below to resend your confirmation email.
+screen.accountnotconfirmed.osflogin.button.resendConfirmation=Resend confirmation email
screen.accountnotconfirmed.idplogin.heading=Account not confirmed
screen.accountnotconfirmed.idplogin.message=The OSF account associated with the email has been registered but not confirmed. Our records show that this account was created via ORCiD login. Please check your email (and spam folder) for the confirmation link. If you believe this should not happen, please contact OSF Support.
-screen.loginnotallowed.button.resendConfirmation=Resend confirmation email
screen.accountdisabled.heading=Account disabled
screen.accountdisabled.message=The OSF account associated with the email has been disabled. Please contact OSF Support to regain access.
screen.shouldnothappen.heading=Account not active
diff --git a/cas-server-webapp/src/main/webapp/WEB-INF/view/jsp/default/ui/casLoginNotAllowedView.jsp b/cas-server-webapp/src/main/webapp/WEB-INF/view/jsp/default/ui/casAccountNotConfirmedOsfLoginView.jsp
similarity index 80%
rename from cas-server-webapp/src/main/webapp/WEB-INF/view/jsp/default/ui/casLoginNotAllowedView.jsp
rename to cas-server-webapp/src/main/webapp/WEB-INF/view/jsp/default/ui/casAccountNotConfirmedOsfLoginView.jsp
index d5fa4844..2410a66e 100644
--- a/cas-server-webapp/src/main/webapp/WEB-INF/view/jsp/default/ui/casLoginNotAllowedView.jsp
+++ b/cas-server-webapp/src/main/webapp/WEB-INF/view/jsp/default/ui/casAccountNotConfirmedOsfLoginView.jsp
@@ -1,6 +1,6 @@
<%--
- Copyright (c) 2015. Center for Open Science
+ Copyright (c) 2020. Center for Open Science
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -16,19 +16,19 @@
--%>
-<%-- Login exception page: account not confirmed --%>
+<%-- Login exception page: account created via OSF email-password sign-up but not confirmed --%>