...
IdPの認証画面に直接アクセスしたときのエラー表示追加方法
IdPの認証画面でユーザが遭遇するエラーの一般的なものとして、SPを経由せずにブックマーク、履歴、戻るボタン等からIdPの認証画面に直接アクセスしてしまうというものがあります。
idp.warに含まれるlogin.jspを後述の通り修正することで、SPを経由せずにIdPの認証画面に直接アクセスした場合はエラーを表示させることができます。
login.jspに以下の内容を追記します。
コード ブロック | ||||
---|---|---|---|---|
| ||||
<%@ page import="edu.internet2.middleware.shibboleth.idp.util.HttpServletHelper" %>
<%@ page import="org.opensaml.util.storage.StorageService" %>
<%@ page import="edu.internet2.middleware.shibboleth.idp.authn.LoginContext" %>
<%
StorageService storageService = HttpServletHelper.getStorageService(application);
LoginContext loginContext = HttpServletHelper.getLoginContext(storageService,application, request);
%>
<% if (loginContext == null) {%>
<!-- エラー時に表示するメッセージ等をここに記載します。以下はエラーメッセージの例です。 -->
<p><font color="red">Error:</font> Direct access to this page is not supported.</p>
<% } else { %>
<!-- 通常の認証画面部分をこちらに記載します。 -->
<% } %>
|
例) IdP 2.4.0のデフォルトのlogin.jspをベースに上記内容を適用した場合
Section | ||||
---|---|---|---|---|
|
SP関連情報
Embedded DS
特定の言語で表示する方法
...