6.xから7.0
6.xから7.0では多くの構造的な変化がありますが、アップグレードのために必要なことはほとんどありません。 アップグレードに必要な最も重要なことは、portal.properties
とPrefProps
(6.x) に保管された値を ConfigurationAdmin (7.0) に移行するよう設定することです。 このプロセスを自動化するためLDAPPropertiesVerifyProcessを用意しています。
LDAPPropertiesVerifyProcess は、ポータルのVerifyProcess の一部として起動し、古いLDAP設定をConfigurationAdmin に基づく新しい設定に自動的に変換します。 これは以下のアップグレードを含みます:
- 各ポータルインスタンスのLDAPAuthConfiguration
- 各ポータルインスタンスのLDAPExportConfiguration
- 各ポータルインスタンスのLDAPImportConfiguration
- 各ポータルインスタンスと設定されたLDAPサーバーのLDAPServerConfiguration
- 各ポータルインスタンスのSystemLDAPConfiguration
破壊的な変更
自動的に移行されないプロパティの1つがldap.attrs.transformer.impl.
です。 このプロパティは、ユーザーが独自のクラス を設定できるようにします。このクラスは、ユーザーまたはグループがLDAPストアにインポートされる前に、com.liferay.portal.security.ldap.AttributesTransformer
を実装し、LDAP属性を変更するものです。
7.0のOSGiインフラストラクチャでは、このプロパティを設定する必要はありません。 代わりに、AttributeTransformerの実装をレジストリにパブリッシュするだけです。
Declarative Servicesを利用している場合の例:
@Component(immediate = true, service = AttributesTransformer.class)
public class MyAttributesTransformer implements AttributesTransformer {
@Override
public Attributes transformGroup(Attributes attributes) {
…..
return attributes;
}
@Override
public Attributes transformUser(Attributes attributes) {
…..
return attributes;
}
}
開発の考慮事項
LDAPの機能の開発において考慮された最も重要な点は、プロダクションへの設定を推進することです。 7.0以前、portal.properties
を使用していたお客様は、ポータル設定ユーザーインターフェースを使った設定の管理ができませんでした。 7.0で、このプロセスの問題がなくなりました。
お客様は、設定値をcfgファイルに記録し、特定の環境に展開できます。 展開された値は、ポータル設定ユーザーインターフェースまたはシステム設定UIで変更できます。
ファイルを使って設定するには:
com.liferay.portal.ldap.authenticator.configuration.LDAPAuthConfiguration-<companyId>.cfg
という名前の設定ファイルを作成します。
ファイルは、LDAP認証設定インターフェースで定義されたプロパティを含む必要があります。 例えば:
com.liferay.portal.ldap.authenticator.configuration.LDAPAuthConfiguration-20202.cfg
companyId=20202
enabled=true
method=bind
passwordEncryptionAlgorithm=NONE
passwordPolicyEnabled=false
required=false
の内部では
このファイルを$liferay_home/osgi/configsに展開します 。
この方法により、コントロールパネルを使うことなくLDAP認証を設定できます。
その他のLDAPに関する設定ファイルは、適切な命名規則に従う必要があります:
-
com.liferay.portal.ldap.exportimport.configuration.LDAPExportConfiguration-<companyId>.cfg
-
com.liferay.portal.ldap.exportimport.configuration.LDAPImportConfiguration<companyId>.cfg
-
com.liferay.portal.ldap.exportimport.configuration.LDAPServerConfiguration-<companyId>-<ldapServerId>.cfg
-
com.liferay.portal.ldap.exportimport.configuration.SystemLDAPConfiguration<companyId>.cfg