-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use a new exception for IdP unconfirmed account
- Loading branch information
Showing
6 changed files
with
97 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
.../main/java/io/cos/cas/authentication/exceptions/AccountNotConfirmedIdPLoginException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* 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. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.cos.cas.authentication.exceptions; | ||
|
||
import javax.security.auth.login.AccountException; | ||
|
||
/** | ||
* Describes an error condition where authentication occurs from an unconfirmed account created by external identity | ||
* provider (IdP) login. This exception only applies to IdPs that require user email confirmation. Currently, there | ||
* is only one: ORCiD. Institution IdPs do not require user email confirmation. | ||
* | ||
* @author Longze Chen | ||
* @since 20.0.0 | ||
*/ | ||
public class AccountNotConfirmedIdPLoginException extends AccountException { | ||
|
||
private static final long serialVersionUID = 2165106893184566462L; | ||
|
||
/** Instantiates a new exception (default). */ | ||
public AccountNotConfirmedIdPLoginException() { | ||
super(); | ||
} | ||
|
||
/** | ||
* Instantiates a new exception with a given message. | ||
* | ||
* @param message the message | ||
*/ | ||
public AccountNotConfirmedIdPLoginException(final String message) { | ||
super(message); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -146,6 +146,8 @@ screen.badworkstation.message=Please contact <a style="white-space: nowrap" href | |
# 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.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 <a style="white-space: nowrap" href="mailto:[email protected]">OSF Support</a>. | ||
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 <a style="white-space: nowrap" href="mailto:[email protected]">OSF Support</a> to regain access. | ||
|
41 changes: 41 additions & 0 deletions
41
...webapp/src/main/webapp/WEB-INF/view/jsp/default/ui/casAccountNotConfirmedIdPLoginView.jsp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<%-- | ||
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. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
--%> | ||
|
||
<%-- Login exception page: account created via external IdP login but not confirmed --%> | ||
|
||
<jsp:directive.include file="includes/top.jsp"/> | ||
|
||
<div id="msg" class="errors"> | ||
<h2><spring:message code="screen.accountnotconfirmed.idplogin.heading"/></h2> | ||
<p><spring:message code="screen.accountnotconfirmed.idplogin.message"/></p> | ||
</div> | ||
|
||
<spring:message code="screen.osf.login.message.error" var="errorDescription"/> | ||
<script> | ||
description = document.getElementById("description"); | ||
if (description != null) { | ||
description.innerHTML = "<br><br>${errorDescription}"; | ||
} | ||
</script> | ||
|
||
<c:set var="linkSignIn" value="true"/> | ||
<c:set var="linkSignOut" value="false"/> | ||
<c:set var="linkCreateAccount" value="true"/> | ||
<c:set var="linkBackToOsf" value="true"/> | ||
|
||
<jsp:directive.include file="includes/bottom.jsp"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters