Confluence で「ログイン情報を記憶する」機能を設定する方法
Code Changes Required
This configuration requires changing the Confluence code in your installation. You will need to reapply these changes whenever you upgrade Confluence. Proceed with caution.
目的
The Confluence Administration Console does not provide an option for disabling the 'Remember Me' feature. There is a feature request for this capability CONFSERVER-66598 - Getting issue details... STATUS .
As a workaround, you can modify the Velocity file login.vm
as described below.
ソリューション
Non clustered (single node)
The steps required are as follows:You should NOT see any cookie with the name: seraph.confluence
- Confluence を停止します。
- Go to your Confluence installation directory
- Locate the
<CONFLUENCE-INSTALLATION>/confluence/login.vm
file and make a backup copy - Edit the file
Locate the following line of code:
#bodytag( "Component" "label='remember.accesskey'" "name='os_cookie'" "value='false'" "theme='aui'" "template='onofflist.vm'") #end
Comment out the line so that it looks like this (note the extra '#' character in front):
##bodytag( "Component" "label='remember.accesskey'" "name='os_cookie'" "value='false'" "theme='aui'" "template='onofflist.vm'") #end
- ファイルを保存して Confluence を再起動します
- Repeat the above steps each time you install a new version of Confluence.
クラスタ化
In Confluence Data Center, we enforce the Remember Me setting silently in order to account for inconsistencies in the session affinity between cluster nodes.
To show the 'Remember me' checkbox:
- Confluence を停止します。
- Set the
cluster.login.rememberme.enabled
system property totrue
. - Confluence を再起動します。
To disable the 'Remember me' feature:
- Confluence を停止します。
- Go to Confluence installation directory.
- Locate the
<CONFLUENCE-INSTALLATION>/confluence/login.vm
file and make a backup copy. - Edit the file.
Locate the following section of code:
#if ($action.shouldRememberMeCheckboxBeOmitted()) <input type="hidden" name="os_cookie" value="true"/> #else #bodytag( "Component" "label='remember.accesskey'" "name='os_cookie'" "value='false'" "theme='aui'" "template='onofflist.vm'") #end #end
and change the 'Remember me' cookie value to
false
as follows.<input type="hidden" name="os_cookie" value="false"/>
ファイルを保存して Confluence を再起動します。
- Repeat the above steps for each cluster node.
You'll need to make these modifications each time you upgrade to a new version of Confluence.
Verify the Fix
In order to verify if your changes were applied, you will need to do the following:
- Log out of your current session
- After you open Confluence and login, check your browser cookies
- If you disabled 'remember me', you should NOT see any cookie with the name:
seraph.confluence
既知の問題
On Confluence 8.0, changes were introduced to the login.vm file:
#if ($action.shouldRememberMeCheckboxBeOmitted())
<input type="hidden" name="os_cookie" value="true"/>
#else
#scomponent("label='remember.accesskey'" "name='os_cookie'" "value='false'" "theme='aui'" "template='onofflist.vm'")
#end
#end
Please note that the workaround suggested will not work on this version.
参考資料
HTTP authentication with Seraph
Confluence のセッション タイムアウトを調整する方法