Skip to content

Commit 6685ffe

Browse files
committed
OSF CAS customized authn error pages rework
* The CAS unavailable / server error page is excluded for now. * Follow the "banner-title-heading-messag-button-link" design. * Sign-up button is disabled for all authn error pages. * Depending on the context, the button and link can either be: 1) clear current CAS session and back to login with default services (e.g. service unauthorized), or 2) clear both CAS and OSF sessions and go back to the OSF home page. * No extra CSS tweaks / hacks * Added registered service JSON definition for relative paths /login? and /logout?. This allows CAS to redirect the flow back to a new login flow after an logout flow has ended.
1 parent 3891dc0 commit 6685ffe

8 files changed

Lines changed: 211 additions & 108 deletions
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"@class": "org.apereo.cas.services.RegexRegisteredService",
3+
"serviceId": "^/(login|logout)\\?.*",
4+
"name": "",
5+
"description": "",
6+
"id": 203948234207101,
7+
"evaluationOrder": 10,
8+
"logo": "/images/osf-banner.png",
9+
"attributeReleasePolicy": {
10+
"@class": "org.apereo.cas.services.ReturnAllowedAttributeReleasePolicy",
11+
"allowedAttributes": [
12+
"java.util.ArrayList",
13+
[
14+
"givenName",
15+
"familyName",
16+
"username"
17+
]
18+
]
19+
},
20+
"accessStrategy": {
21+
"@class": "org.apereo.cas.services.DefaultRegisteredServiceAccessStrategy",
22+
"delegatedAuthenticationPolicy": {
23+
"@class": "org.apereo.cas.services.DefaultRegisteredServiceDelegatedAuthenticationPolicy",
24+
"allowedProviders": [
25+
"java.util.ArrayList",
26+
[]
27+
],
28+
"permitUndefined": false
29+
}
30+
}
31+
}

src/main/resources/templates/casAccountDisabledView.html

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,29 +9,42 @@
99
<link href="../../static/css/cas.css" rel="stylesheet" th:remove="tag" />
1010
</head>
1111

12-
<body>
13-
<main role="main" class="container mt-3 mb-3">
14-
<div layout:fragment="content" class="banner banner-danger mdc-card p-4 m-auto w-card-narrow">
15-
<div class="login-error-card">
16-
<div th:replace="fragments/osfbannerui :: osfBannerUI">
17-
<a href="fragments/osfbannerui.html"></a>
18-
</div>
19-
<h3 class="text-center title-danger">
12+
<body class="mdc-typography">
13+
<div layout:fragment="content" class="d-flex justify-content-center">
14+
15+
<div class="d-flex justify-content-center flex-md-row flex-column mdc-card mdc-card-content w-lg-30">
16+
<section class="login-error-card">
17+
<section>
18+
<div th:replace="fragments/osfbannerui :: osfBannerUI">
19+
<a href="fragments/osfbannerui.html"></a>
20+
</div>
21+
</section>
22+
<section class="text-without-mdi text-center text-bold text-large margin-large-vertical title-danger">
2023
<span th:utext="#{screen.authnerror.instructions}"></span>
21-
</h3>
24+
</section>
2225
<hr class="my-4" />
23-
<div class="card-message">
26+
<section class="card-message">
2427
<h2 th:utext="#{screen.accountdisabled.heading}"></h2>
2528
<p th:utext="#{screen.accountdisabled.message}"></p>
26-
</div>
27-
<div class="form-button">
29+
</section>
30+
<section class="form-button">
2831
<a class="mdc-button mdc-button--raised button-osf-blue" th:href="@{/logout(service=${osfUrl.logout})}">
2932
<span class="mdc-button__label" th:utext="#{screen.authnerror.button.backtoosf}"></span>
3033
</a>
31-
</div>
32-
</div>
34+
</section>
35+
<hr class="my-4" />
36+
<section class="text-with-mdi" th:with="loginUrl=@{/login(errorSource=401)}">
37+
<i class="mdi mdi-login mdi-before-text"></i>
38+
<span><a th:href="@{/logout(service=${loginUrl})}" th:utext="#{screen.error.page.loginagain}"></a></span>
39+
</section>
40+
</section>
3341
</div>
34-
</main>
42+
43+
<script type="text/javascript">
44+
disableSignUpButton();
45+
</script>
46+
47+
</div>
3548
</body>
3649

3750
</html>

src/main/resources/templates/casAccountNotConfirmedIdPView.html

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,29 +9,42 @@
99
<link href="../../static/css/cas.css" rel="stylesheet" th:remove="tag" />
1010
</head>
1111

12-
<body>
13-
<main role="main" class="container mt-3 mb-3">
14-
<div layout:fragment="content" class="banner banner-danger mdc-card p-4 m-auto w-card-narrow">
15-
<div class="login-error-card">
16-
<div th:replace="fragments/osfbannerui :: osfBannerUI">
17-
<a href="fragments/osfbannerui.html"></a>
18-
</div>
19-
<h3 class="text-center title-danger">
12+
<body class="mdc-typography">
13+
<div layout:fragment="content" class="d-flex justify-content-center">
14+
15+
<div class="d-flex justify-content-center flex-md-row flex-column mdc-card mdc-card-content w-lg-30">
16+
<section class="login-error-card">
17+
<section>
18+
<div th:replace="fragments/osfbannerui :: osfBannerUI">
19+
<a href="fragments/osfbannerui.html"></a>
20+
</div>
21+
</section>
22+
<section class="text-without-mdi text-center text-bold text-large margin-large-vertical title-danger">
2023
<span th:utext="#{screen.authnerror.instructions}"></span>
21-
</h3>
24+
</section>
2225
<hr class="my-4" />
23-
<div class="card-message">
26+
<section class="card-message">
2427
<h2 th:utext="#{screen.accountnotconfirmedidp.heading}"></h2>
2528
<p th:utext="#{screen.accountnotconfirmedidp.message}"></p>
26-
</div>
27-
<div class="form-button">
28-
<a class="mdc-button mdc-button--raised button-osf-blue" th:href="@{/logout(service=${osfUrl.logout})}">
29-
<span class="mdc-button__label" th:utext="#{screen.authnerror.button.backtoosf}"></span>
29+
</section>
30+
<section class="form-button">
31+
<a class="mdc-button mdc-button--raised button-osf-blue" th:href="@{${osfUrl.resendConfirmation}}">
32+
<span class="mdc-button__label" th:utext="#{screen.authnerror.button.resendosfconfirmation}"></span>
3033
</a>
31-
</div>
32-
</div>
34+
</section>
35+
<hr class="my-4" />
36+
<section class="text-with-mdi">
37+
<i class="mdi mdi-logout mdi-before-text"></i>
38+
<span><a th:href="@{/logout(service=${osfUrl.logout})}" th:utext="#{screen.authnerror.button.backtoosf}"></a></span>
39+
</section>
40+
</section>
3341
</div>
34-
</main>
42+
43+
<script type="text/javascript">
44+
disableSignUpButton();
45+
</script>
46+
47+
</div>
3548
</body>
3649

3750
</html>

src/main/resources/templates/casAccountNotConfirmedOsfView.html

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,45 +11,39 @@
1111

1212
<body class="mdc-typography">
1313
<div layout:fragment="content" class="d-flex justify-content-center">
14+
1415
<div class="d-flex justify-content-center flex-md-row flex-column mdc-card mdc-card-content w-lg-30">
1516
<section class="login-error-card">
16-
1717
<section>
1818
<div th:replace="fragments/osfbannerui :: osfBannerUI">
1919
<a href="fragments/osfbannerui.html"></a>
2020
</div>
2121
</section>
22-
2322
<section class="text-without-mdi text-center text-bold text-large margin-large-vertical title-danger">
2423
<span th:utext="#{screen.authnerror.instructions}"></span>
2524
</section>
26-
2725
<hr class="my-4" />
28-
2926
<section class="card-message">
3027
<h2 th:utext="#{screen.accountnotconfirmedosf.heading}"></h2>
3128
<p th:utext="#{screen.accountnotconfirmedosf.message}"></p>
3229
</section>
33-
3430
<section class="form-button">
3531
<a class="mdc-button mdc-button--raised button-osf-blue" th:href="@{${osfUrl.resendConfirmation}}">
3632
<span class="mdc-button__label" th:utext="#{screen.authnerror.button.resendosfconfirmation}"></span>
3733
</a>
3834
</section>
39-
4035
<hr class="my-4" />
41-
4236
<section class="text-with-mdi">
43-
<i class="mdi mdi-keyboard-backspace mdi-before-text"></i>
37+
<i class="mdi mdi-logout mdi-before-text"></i>
4438
<span><a th:href="@{/logout(service=${osfUrl.logout})}" th:utext="#{screen.authnerror.button.backtoosf}"></a></span>
4539
</section>
46-
4740
</section>
4841
</div>
4942

5043
<script type="text/javascript">
5144
disableSignUpButton();
5245
</script>
46+
5347
</div>
5448
</body>
5549

src/main/resources/templates/casInstitutionSsoFailedView.html

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,29 +9,42 @@
99
<link href="../../static/css/cas.css" rel="stylesheet" th:remove="tag" />
1010
</head>
1111

12-
<body>
13-
<main role="main" class="container mt-3 mb-3">
14-
<div layout:fragment="content" class="banner banner-danger mdc-card p-4 m-auto w-card-narrow">
15-
<div class="login-error-card">
16-
<div th:replace="fragments/osfbannerui :: osfBannerUI">
17-
<a href="fragments/osfbannerui.html"></a>
18-
</div>
19-
<h3 class="text-center title-danger">
12+
<body class="mdc-typography">
13+
<div layout:fragment="content" class="d-flex justify-content-center">
14+
15+
<div class="d-flex justify-content-center flex-md-row flex-column mdc-card mdc-card-content w-lg-30">
16+
<section class="login-error-card">
17+
<section>
18+
<div th:replace="fragments/osfbannerui :: osfBannerUI">
19+
<a href="fragments/osfbannerui.html"></a>
20+
</div>
21+
</section>
22+
<section class="text-without-mdi text-center text-bold text-large margin-large-vertical title-danger">
2023
<span th:utext="#{screen.authnerror.instructions}"></span>
21-
</h3>
24+
</section>
2225
<hr class="my-4" />
23-
<div class="card-message">
26+
<section class="card-message">
2427
<h2 th:utext="#{screen.institutionssofailed.heading}"></h2>
2528
<p th:utext="#{screen.institutionssofailed.message}"></p>
26-
</div>
27-
<div class="form-button">
28-
<a class="mdc-button mdc-button--raised button-osf-blue" th:href="@{/logout(service=${osfUrl.logout})}">
29-
<span class="mdc-button__label" th:utext="#{screen.authnerror.button.backtoosf}"></span>
29+
</section>
30+
<section class="form-button" th:with="loginUrl=@{/login(errorSource=401)}">
31+
<a class="mdc-button mdc-button--raised button-osf-blue" th:href="@{/logout(service=${loginUrl})}">
32+
<span class="mdc-button__label" th:utext="#{screen.error.page.loginagain}"></span>
3033
</a>
31-
</div>
32-
</div>
34+
</section>
35+
<hr class="my-4" />
36+
<section class="text-with-mdi">
37+
<i class="mdi mdi-logout mdi-before-text"></i>
38+
<span><a th:href="@{/logout(service=${osfUrl.logout})}" th:utext="#{screen.authnerror.button.backtoosf}"></a></span>
39+
</section>
40+
</section>
3341
</div>
34-
</main>
42+
43+
<script type="text/javascript">
44+
disableSignUpButton();
45+
</script>
46+
47+
</div>
3548
</body>
3649

3750
</html>

src/main/resources/templates/casInvalidUserStatusView.html

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,29 +9,42 @@
99
<link href="../../static/css/cas.css" rel="stylesheet" th:remove="tag" />
1010
</head>
1111

12-
<body>
13-
<main role="main" class="container mt-3 mb-3">
14-
<div layout:fragment="content" class="banner banner-danger mdc-card p-4 m-auto w-card-narrow">
15-
<div class="login-error-card">
16-
<div th:replace="fragments/osfbannerui :: osfBannerUI">
17-
<a href="fragments/osfbannerui.html"></a>
18-
</div>
19-
<h3 class="text-center title-danger">
12+
<body class="mdc-typography">
13+
<div layout:fragment="content" class="d-flex justify-content-center">
14+
15+
<div class="d-flex justify-content-center flex-md-row flex-column mdc-card mdc-card-content w-lg-30">
16+
<section class="login-error-card">
17+
<section>
18+
<div th:replace="fragments/osfbannerui :: osfBannerUI">
19+
<a href="fragments/osfbannerui.html"></a>
20+
</div>
21+
</section>
22+
<section class="text-without-mdi text-center text-bold text-large margin-large-vertical title-danger">
2023
<span th:utext="#{screen.authnerror.instructions}"></span>
21-
</h3>
24+
</section>
2225
<hr class="my-4" />
23-
<div class="card-message">
26+
<section class="card-message">
2427
<h2 th:utext="#{screen.invaliduserstatus.heading}"></h2>
2528
<p th:utext="#{screen.invaliduserstatus.message}"></p>
26-
</div>
27-
<div class="form-button">
29+
</section>
30+
<section class="form-button">
2831
<a class="mdc-button mdc-button--raised button-osf-blue" th:href="@{/logout(service=${osfUrl.logout})}">
2932
<span class="mdc-button__label" th:utext="#{screen.authnerror.button.backtoosf}"></span>
3033
</a>
31-
</div>
32-
</div>
34+
</section>
35+
<hr class="my-4" />
36+
<section class="text-with-mdi" th:with="loginUrl=@{/login(errorSource=401)}">
37+
<i class="mdi mdi-login mdi-before-text"></i>
38+
<span><a th:href="@{/logout(service=${loginUrl})}" th:utext="#{screen.error.page.loginagain}"></a></span>
39+
</section>
40+
</section>
3341
</div>
34-
</main>
42+
43+
<script type="text/javascript">
44+
disableSignUpButton();
45+
</script>
46+
47+
</div>
3548
</body>
3649

3750
</html>

src/main/resources/templates/casInvalidVerificationKeyView.html

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,29 +9,42 @@
99
<link href="../../static/css/cas.css" rel="stylesheet" th:remove="tag" />
1010
</head>
1111

12-
<body>
13-
<main role="main" class="container mt-3 mb-3">
14-
<div layout:fragment="content" class="banner banner-danger mdc-card p-4 m-auto w-card-narrow">
15-
<div class="login-error-card">
16-
<div th:replace="fragments/osfbannerui :: osfBannerUI">
17-
<a href="fragments/osfbannerui.html"></a>
18-
</div>
19-
<h3 class="text-center title-danger">
12+
<body class="mdc-typography">
13+
<div layout:fragment="content" class="d-flex justify-content-center">
14+
15+
<div class="d-flex justify-content-center flex-md-row flex-column mdc-card mdc-card-content w-lg-30">
16+
<section class="login-error-card">
17+
<section>
18+
<div th:replace="fragments/osfbannerui :: osfBannerUI">
19+
<a href="fragments/osfbannerui.html"></a>
20+
</div>
21+
</section>
22+
<section class="text-without-mdi text-center text-bold text-large margin-large-vertical title-danger">
2023
<span th:utext="#{screen.authnerror.instructions}"></span>
21-
</h3>
24+
</section>
2225
<hr class="my-4" />
23-
<div class="card-message">
26+
<section class="card-message">
2427
<h2 th:utext="#{screen.invalidverificationkey.heading}"></h2>
2528
<p th:utext="#{screen.invalidverificationkey.message}"></p>
26-
</div>
27-
<div class="form-button">
29+
</section>
30+
<section class="form-button">
2831
<a class="mdc-button mdc-button--raised button-osf-blue" th:href="@{/logout(service=${osfUrl.logout})}">
2932
<span class="mdc-button__label" th:utext="#{screen.authnerror.button.backtoosf}"></span>
3033
</a>
31-
</div>
32-
</div>
34+
</section>
35+
<hr class="my-4" />
36+
<section class="text-with-mdi" th:with="loginUrl=@{/login(errorSource=401)}">
37+
<i class="mdi mdi-login mdi-before-text"></i>
38+
<span><a th:href="@{/logout(service=${loginUrl})}" th:utext="#{screen.error.page.loginagain}"></a></span>
39+
</section>
40+
</section>
3341
</div>
34-
</main>
42+
43+
<script type="text/javascript">
44+
disableSignUpButton();
45+
</script>
46+
47+
</div>
3548
</body>
3649

3750
</html>

0 commit comments

Comments
 (0)