How to change the Forgot Password link in Confluence to redirect to an alternate page
Purpose
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.
- Make a copy of this file as a backup.
- 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
- Restart 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:
- Shut down your Confluence server.
- In the Confluence installation directory, find the file /
confluence/login.vm
. The path will look something like <confluence-install>/confluence/login.vm. - Make a copy of this file as a backup.
- 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
- Start Confluence and test your changes.
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.