<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>LDAP authentication and new users</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=113969916" />
  <subtitle>LDAP authentication and new users</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=113969916</id>
  <updated>2026-04-04T20:17:01Z</updated>
  <dc:date>2026-04-04T20:17:01Z</dc:date>
  <entry>
    <title>RE: LDAP authentication and new users</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113990532" />
    <author>
      <name>Christoph Rabel</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113990532</id>
    <updated>2019-06-14T06:44:41Z</updated>
    <published>2019-06-14T06:44:41Z</published>
    <summary type="html">The only problem we usually have is when users are deleted/moved away (in another tree) in ldap. The user in Liferay is still there and while it might not be able to authenticate, it will still be visible/available. e.g. in the search or in applications.&lt;br /&gt;Please note that this might not be an issue for you at all. It depends on your usecases.&lt;br /&gt;Anyway: We resolved that by implementing a daily job that checks if a user is gone and removes it in portal too.</summary>
    <dc:creator>Christoph Rabel</dc:creator>
    <dc:date>2019-06-14T06:44:41Z</dc:date>
  </entry>
  <entry>
    <title>RE: LDAP authentication and new users</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113983534" />
    <author>
      <name>Pete Helgren</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113983534</id>
    <updated>2019-06-13T13:59:52Z</updated>
    <published>2019-06-13T13:59:52Z</published>
    <summary type="html">Thanks Olaf.  Just what I figured but not what I hoped.  I am going to go with the approach I am using.  It seems to work OK and over time I can refine it if I run into issues.&lt;br /&gt;I really appreciate the confirmation.</summary>
    <dc:creator>Pete Helgren</dc:creator>
    <dc:date>2019-06-13T13:59:52Z</dc:date>
  </entry>
  <entry>
    <title>RE: LDAP authentication and new users</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113971376" />
    <author>
      <name>Olaf Kock</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113971376</id>
    <updated>2019-06-12T16:08:32Z</updated>
    <published>2019-06-12T16:08:32Z</published>
    <summary type="html">&lt;div class="quote-title"&gt;Pete Helgren:&lt;/div&gt;&lt;blockquote&gt;&lt;br /&gt;UPDATE:  The warning was a red herring and  all of what I described above DOES work.  So, the only question in all of this that is unanswered is:&lt;br /&gt;Can a user be completely ephemeral? That is, not persisted in the DB?  I am think that you cannot have a user that hasn&amp;#39;t been persisted based on what I see, but could someone confirm that?&lt;br /&gt;&lt;/blockquote&gt;Correct assumption.&lt;br /&gt;Background: Liferay will need user information even if LDAP is currently not available, or if a user has been renamed/removed in LDAP. E.g. in order to show the author, with name, profile picture and job description in a directory, as blog- or forum-post-author. Or as the creator of another asset. That&amp;#39;s when the database steps in, thus the user information always will be copied into the database. &lt;br /&gt;However, this copy happens at least during log in of a user, so that you can be sure the information isn&amp;#39;t stale for any logged in user.  You can also update user information based on a schedule, but typically this is not too interesting. At the time of login, the information is guaranteed to be most up-to-date, and that&amp;#39;s when it&amp;#39;s updated anyways.</summary>
    <dc:creator>Olaf Kock</dc:creator>
    <dc:date>2019-06-12T16:08:32Z</dc:date>
  </entry>
  <entry>
    <title>LDAP authentication and new users</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113969915" />
    <author>
      <name>Pete Helgren</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113969915</id>
    <updated>2019-06-12T14:44:36Z</updated>
    <published>2019-06-12T14:44:36Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;I am in the process of modifying my current portal to do three things in a new way:&lt;br&gt;&lt;ol style="list-style: decimal outside;" start="1"&gt;&lt;li&gt;Authenticate users using LDAP (Active Directory)&lt;/li&gt;&lt;li&gt;Use a value from the LDAP/AD process as a custom user&amp;nbsp;field (OU is what I am currently using because it basically identifies the department)&lt;/li&gt;&lt;li&gt;Assign roles based on the value returned by the LDAP/AD process&lt;/li&gt;&lt;/ol&gt;The "gotcha!" is that I would prefer this to be "ephemeral".&amp;nbsp; That is, all of this is done in memory without persisting the user and roles in the DB.&amp;nbsp; Why?&amp;nbsp; Because the roles will constantly change as people move around in the organization and I am trying to avoid reading through the roles each time and determining which ones need to be removed if the position changes.&amp;nbsp; So, first question is:&amp;nbsp; Is this even possible?&lt;br&gt;I have been able to get the LDAP authentication working.&amp;nbsp; I have the value from AD being added as a custom field.&amp;nbsp; And, I have logic that will assign roles at login to the user based on the value from the LDAP/AD process.&amp;nbsp; However, I have only been able to do that when the user has already been created in the DB.&amp;nbsp; So, if I cannot do this all in memory without persisting the user and roles in the DB, how should I handle a brand new user that has never signed in before but is a legitimate user as authenticated in LDAP?&amp;nbsp; My first attempt at trying a new user generated this response:&lt;br&gt;&lt;pre&gt;&lt;code&gt;WARN &amp;amp;nbsp;[http-nio-8080-exec-9][SecurityPortletContainerWrapper:348] User 0 is not allowed to access URL [url=http://localhost:8080/web/guest/welcome and portlet com_liferay_login_web_portlet_LoginPortlet]http://localhost:8080/web/guest/welcome and portlet com_liferay_login_web_portlet_LoginPortlet[/url]
&lt;/code&gt;&lt;/pre&gt;&lt;blockquote&gt;Searching on the warning produces several unrelated causes and solutions, so I am not sure if I have a configuration issue or just bad assumptions and logic in my code.&amp;nbsp; Assuming that a completely ephemeral user isn't possible, what would be the suggest way to handle the following:&lt;ol style="list-style: decimal outside;" start="1"&gt;&lt;li&gt;&amp;nbsp; Authenticate the user using LDAP&lt;/li&gt;&lt;li&gt;Add the user and the custom field data to the DB&lt;/li&gt;&lt;li&gt;Assign roles to the user&lt;/li&gt;&lt;li&gt;Access the portal and menus based on the role assignments&lt;/li&gt;&lt;/ol&gt;I am most of the way there.&amp;nbsp; I think I just need help or a better understanding of what is going on when a user authenticates with LDAP and that user is not in the DB....&lt;/blockquote&gt;UPDATE:&amp;nbsp; The warning was a red herring and&amp;nbsp; all of what I described above DOES work.&amp;nbsp; So, the only question in all of this that is unanswered is:&lt;br&gt;Can a user be completely ephemeral?&amp;nbsp;That is, not persisted in the DB?&amp;nbsp; I am think that you cannot have a user that hasn't been persisted based on what I see, but could someone confirm that?&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Pete Helgren</dc:creator>
    <dc:date>2019-06-12T14:44:36Z</dc:date>
  </entry>
</feed>
