I need to modify the Forgot Password link on the log-in page
Asked by Chris Kent:

We use LDAP to manage users passwords, and a lot of users can't grasp the concept that they need to use their domain password for Confluence.

<br />

When they try to login they get flustered when it doesn't work, they then follow the instructions when pressing the "Forgot Password". This tries to get them to change their password, which is not possible and Confluence throws an error.

What I want to do is change the behaviour of this link (Forgot Password) such that I can display a pop-up message with details of how they need to log in. ie. "Please use you windows domain password to logon to Confluence", and then return back to the logon page (no emails/no reset password confusion etc...)

Does anyone have any ideas how to do this?


Answers:
author: Chris Kent
body: OK, so I have spent the last day doing this myself, for both Confluence and JIRA. For others interested in how to do this, it's not that hard. I'll show the Confluence changes needed in this Answer, and then JIRA in the following Anser.

For Confluence:

Edit the file ../confluence/forgotuserpassword.vm

***Replace the contents of this file with:***

\<html\>

\<head\>

\<title\>$action.getText("title.forgot.pass")\</title\>

\</head\>

\<body\>

\<content tag="bodyClass"\>login forgot-password\</content\>

\<div id="login-container" class="userpassword-section"\>

\<h2\>$action.getText("title.forgot.pass")\</h2\>

#parse ( "/template/includes/actionerrors.vm" )

#if ($action.mailServerConfigured)

#applyDecorator("form-aui")

#decoratorParam("formName" "forgotpasswordform")

#decoratorParam("submitAction" "$req.contextPath/doforgotuserpassword.action")

#decoratorParam("editAction" "$req.contextPath/forgotuserpassword.action")

#decoratorParam("editMode" "true")

#decoratorParam("formStyle" "login-form-container")

\<p\>You must login with you Windows Username and Password.\<br\>

\<br\>

If you still have isues logging in, please contact your Administrators.\<br\>

\<br\>\</p\>

\<fieldset class="compact-form-fields"\>

\<div class="field-group form-buttons compact-form-buttons"\>

\<a href="${req.contextPath}/login.action" class="aui-button aui-style aui-button-link"\>Log In\</a\>

\<a href="${req.contextPath}/contactadministrators.action" class="aui-button aui-style aui-button-link"\>Contact Administrators\</a\>

\</div\>

\</fieldset\>

#end

#else

\<p\>

$action.getText("forgot.pass.nomailserver", \["$action.globalSettings.siteTitle", "$req.contextPath/contactadministrators.action"\])

\</p\>

\<p class="last"\>

\<a href="${req.contextPath}/login.action" class="aui-button aui-style aui-button-primary"\>$action.getText("login.button")\</a\>

\</p\>

#end

\</div\>

\</body\>

\</html\>

comments: author: Anoop K Baby
body: Hi Chris,

This helped me a lot to include a custom "Forgot your password" page. Now I have a question based on it, I am wondering whether you can help me on it. I was trying to include a "Contact Support" button on the default welcome message template. If I try to include the code using html include, it breaking the template. Could you please suggest an alternative.

Regards,

Anoop


author: Chris Kent
body: and for JIRA....

Edit the file ../atlassian-jira/views/forgotlogindetails.jsp

***Replace the contents of this file with:***

\<%@ taglib prefix="ww" uri="webwork" %\>

\<%@ taglib prefix="aui" uri="webwork" %\>

\<%@ taglib prefix="page" uri="sitemesh-page" %\>

\<html\>

\<head\>

\<title\>\<ww:text name="'common.concepts.forgotpassword'"/\>\</title\>

\<meta name="decorator" content="login" /\>

\</head\>

\<body\>

\<header\>

\<h1\>\<ww:text name="'common.concepts.forgotpassword'"/\>\</h1\>

\</header\>

\<page:applyDecorator id="forgot-login" name="auiform"\>

You must login with you Windows Username and Password.\<br\>

\<br\>

If you still have isues logging in, please contact your Administrators.\<br\>

\<br\>

\<a style='color:${textLinkColour};' href='${baseurl}/login.jsp?os_destination=%2Fsecure%2FForgotLoginDetails.jspa'\>Log In\</a\>

\&nbsp;\&nbsp;

\<a style='color:${textLinkColour};' href='${baseurl}/secure/ContactAdministrators!default.jspa'\>Contact Administrators\</a\>

\</page:applyDecorator\>

\</body\>

\</html\>

comments: author: Tina Wuest
body: Hi!

This works fine for my JIRA 6.4.7 testsystem, but has no impact on the 7.0.5 testsystem.

Any ideas how this could work for JIRA 7?

Many thanks

Tina


author: Richard Bergmann
body: Hello

I would be very interested in a solution that works for JIRA 7 / JIRA Service Desk as well.

Thanks!  
Richard


author: Majken Connor
body: We're in the same boat, need to configure this in JIRA 7.1


author: Radoslav Hristov
body: Hello all . I think i found that forgotten password functionality in JIra 7.1\* . You have to modify login.soy file which resides in `<jira-install>/atlassian-jira/WEB-INF/atlassian-bundled-plugins/ `folder . You have to open jira-gadgets-plugin-x-version.jar file and modify login.soy .

<br />

There is "href=" attribute where points to your forgotlogindetails file and you can change to point to another link .It is descibed here : <https://confluence.atlassian.com/jirakb/how-to-customize-the-login-gadget-225122084.html>

Be careful and make a backup of whole JIRA install directory before that :smile: .I will try

Cheers

Radoslav


author: Johannes Rudolf
body: Dear Chris Kent,

many thanks for taking the time to solve this for you and to share the solution with us. It is exactly what I was looking for the last couple days and it even helped us with JIRA 6.3 and Confluence 5.7

Best,

Johannes

comments: author: Chris Kent
body: No problems, glad I could help...


author: Diane Metzger
body: Thanks so much for these instructions...just what I needed. I have the exact same issue "a lot of users can't grasp the concept that they need to use their domain password for Confluence". :-)


author: Ellen Feaheny [AppFusions]
body: What about logging into their domain and automatically be logged into Confluence?

Then you could skip the Confluence login steps all together (and Kerberos auth is very secure too)

That is what this does - <https://www.appfusions.com/display/KBRSCJ/Home>

==

Otherwise - check out this page:

<https://confluence.atlassian.com/display/DOC/Customising+the+Login+Page>

comments: author: Chris Kent
body: Thanks Ellen, but at a cost of $3,500 for each application (Confluence/JIRA) we will not go with Kerberos. Nice idea though, would love it it this was free or much cheaper.

I'll checkout the login page customisation and see how I go.


author: Ellen Feaheny [AppFusions]
body: Guess you are at the 500-user level. Using Crowd makes it a bit less ($5K for both apps).

If you break down per month/per user, its not so bad - and on the market, other solutions for SSO are in the many 10s of $1000s believe it or not.

Its a tricky network area and our customers have never been able to deploy by themselves, even though we provide a lot of doc in the process. Devil in the network configs. On the other hand, have had only successes too on the deployments.

But sure - understand - no worries.

Just sharing options.


Tags: confluence-administration

jira

password