How to change the Forgot Password link in Confluence to redirect to an alternate page
プラットフォームについて: Data Center - この記事は、Data Center プラットフォームのアトラシアン製品に適用されます。
このナレッジベース記事は製品の Data Center バージョン用に作成されています。Data Center 固有ではない機能の Data Center ナレッジベースは、製品のサーバー バージョンでも動作する可能性はありますが、テストは行われていません。サーバー*製品のサポートは 2024 年 2 月 15 日に終了しました。サーバー製品を利用している場合は、アトラシアンのサーバー製品のサポート終了のお知らせページにて移行オプションをご確認ください。
*Fisheye および Crucible は除く
目的
If Confluence is using Crowd or LDAP for user management, the Forgot Password link can be confusing since users can't change their password in Confluence. Follow this guide to modify the Forgot Password link to redirect to a different URL (e.g. Crowd password reset page).
Solution for Confluence 9.0.2 and newer
The login.soy file needs to be updated which lives inside the confluence-frontend-x.x.x.jar file. To modify it, follow steps mentioned in How to edit bundled or system plugins.
- Shutdown your Confluence Server.
- In the Confluence installation directory, find the file
/confluence/WEB-INF/atlassian-bundled-plugins/com.atlassian.confluence.plugins.confluence-frontend-x.x.x.jar.
- このファイルをコピーし、バックアップとします。
- Expand the
com.atlassian.confluence.plugins.confluence-frontend-x.x.x.jar
- Go to
/includes/soy/login.soy
Edit the login.soy file with a text editor to make the required changes. The content contains a mixture of HTML and Velocity. See Velocity Template Overview (in our developer documentation).
<a id="forgot-password" class="aui-button aui-style aui-button-link" href="{contextPath()}/forgotuserpassword.action">{getText('forgot.password')}</a>
- Repackage and replace the
confluence-frontend-x.x.x.jar
- Confluence を再起動します。
- Reload the page and it should now reflect the updated content.
If you encounter any issues, please check that after the expanded jar was repackaged correctly, and that the file format, extension and structure is still the same.
Additionally, please also ensure that the file permissions are set correctly on the updated files, such that the user running the Confluence process has required permissions. For more information, please see: How to set file system permissions for Confluence.
Solution for Confluence 9.0.1 and older
To modify the login page to redirect to another location:
- Confluence サーバーをシャットダウンします。
- In the Confluence installation directory, find the file /
confluence/login.vm
. The path will look something like <confluence-install>/confluence/login.vm. - このファイルをコピーし、バックアップとします。
- Edit the file with a text editor to make the required changes. The content contains a mixture of HTML and Velocity. See Velocity Template Overview (in our developer documentation).
Locate the following line:
<a id="forgot-password" class="aui-button aui-style aui-button-link" href="${req.contextPath}/forgotuserpassword.action">$i18n.getText("forgot.password")</a>
Replace the following snippet with the desired URL:
${req.contextPath}/forgotuserpassword.action
- Confluence を起動し、変更をテストします。
Be careful to test your changes before applying them to a live site. The templates contain code that is vital for Confluence to function, and it is easy to accidentally make a change that prevents use of your site.