# Error OpenID Remote user could not be set

**URL:** <https://discourse.openondemand.org/t/error-openid-remote-user-could-not-be-set/2539>\
**Category:** Get Help\
**Tags:** ondemand2, question\
**Created:** [March 16, 2023, 3:10pm UTC](https://discourse.openondemand.org/t/error-openid-remote-user-could-not-be-set/2539 "2023-03-16T15:10:14Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![jeff.ohrstrom](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jeff.ohrstrom/32/136_2.png) [@jeff.ohrstrom](https://discourse.openondemand.org/u/jeff.ohrstrom)\
**Post date:** [March 17, 2023, 6:15pm UTC](https://discourse.openondemand.org/t/error-openid-remote-user-could-not-be-set/2539/6 "2023-03-17T18:15:55Z")

</div>

OK - I would check the dex logs with `systemctl status ondemand-dex` or `journalctl ondemand-dex`. Dex may be letting you know if there’s something wrong.

I think that `preferredUsernameAttr` is important, so I would go back and enable that.

Beyond that (if setting `preferredUsernameAttr` doesn’t just directly work) - I would start to debug your LDAP (indeed the dex logs may indicate what’s going wrong here).

The 2 things I’d confirm are

- the LDAP query correctly returns the user’s record you’re looking for
- LDAP fields in the record line up with what you’ve configured there.

You can use this topic for some pointers on `ldapsearch`.

> [@Having issues setting up LDAP/Active Directory auth](https://discourse.openondemand.org/t/having-issues-setting-up-ldap-active-directory-auth/675/2):
>
> Hi and welcome! I think 2 things help in triaging ldap issues. First, you could turn log level up with the config file below. Briefly searching on this site, it looks like folks have misconfigured their ldap certificate. The logs may say as much. # added in a new file /opt/rh/httpd24/root/etc/httpd/conf.d/ldap\_debug.conf Loglevel ldap\_module:debug Loglevel authnz\_ldap\_module:debug Next is to step back and hack around on ldapsearch. Looks like you’ve been doing this to test auth, but you may …

---

_[View the full topic](https://discourse.openondemand.org/t/error-openid-remote-user-could-not-be-set/2539)._
