legacy-knowledge-base
公開されました Jul. 2, 2025

LDAPインポートで特定のドメインからのユーザーを拒否してしまう

written-by

Vincent Liu

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

legacy-article

learn-legacy-article-disclaimer-text

本記事では、Liferayプラットフォームのメールアドレス検証機能により、特定のドメインのユーザーがLDAP経由でインポートされない理由を説明し、ビジネスニーズに応じて特定のドメインが必要な場合に解決する方法を紹介します。

または例として、2つのハイフンを使用するドメイン(例: a-b-test.com)は、Liferay Digital Enterprise 7.0 で使用されている defaultemailaddressvalidator を通過せず、結果としてコンソールに以下のエラーメッセージが表示されます:

17:08:48,279 ERROR [liferay/scheduled_user_ldap_import-1][LDAPUserImporterImpl:801] Unable to import user CN=sallyb@l-e-mplastics.com,CN=Users: null:null:{samaccountname=sAMAccountName: 0001107625}
com.liferay.portal.kernel.exception.UserEmailAddressException$MustValidate: Email name address testuser@a-b-test.com must validate with com.liferay.portal.kernel.security.auth.DefaultEmailAddressValidator

解決策

この問題は、 a-b-test.com ドメインで再現可能です。

Liferayプラットフォームがデフォルトで使用するメールアドレス検証ツールは、上記の例のようにハイフンが2つあるドメインを無効なものとして扱うため、このような挙動が観察されますが、これは意図したものです。

これを解決するためには、ドメインを変更するか(これは理想的ではありません)、新しいメールアドレスのバリデーターを実装する必要があります。 これは、ドメインに対応するフックを作成し、 portal-ext.propertiesにある正しいバリデータークラスを指す以下のポータルプロパティを調整することで実現します:

    # Input a class name that implements
    # com.liferay.portal.security.auth.EmailAddressValidator. This class will be
    # called to validate user email addresses.
    #
    # This property is not read by the portal except for portal properties
    # overridden by liferay-hook.xml. It remains here only as a reference.
    #
    #users.email.address.validator=com.liferay.portal.security.auth.DefaultEmailAddressValidator
    #users.email.address.validator=com.liferay.portal.security.auth.LiberalEmailAddressValidator
did-this-article-resolve-your-issue

legacy-knowledge-base