By: Daniel Pimenta user 17 Apr 2023 at 12:38 p.m. CDT

3 Responses
Daniel Pimenta gravatar
Hi, I'm trying to add a Country field to the registration form. I've enabled it on oxtrust UI > Configuration > Manage Registration > attributes And a Country fields shows in the registration form However, when I click register, I get an error message: > Failed to add new person > Registration failed. Please try again, or contact the system administrator. Checking oxtrust logs, I can see it fails with a "Duplicate UID value", which is not accurate because it only happens when I enable the country field, and the UID does not exist in ldap. UID is the username. **oxtrust logs:** ``` 2023-04-17 19:29:55,276 ERROR [qtp353842779-396635] [org.gluu.oxtrust.action.RegisterPersonAction] (RegisterPersonAction.java:346) - Failed to add new person ec612613-f9c0-42d8-9a96-ca6d12189fe2 java.lang.Exception: Duplicate UID value: test_country_username at org.gluu.oxtrust.ldap.service.PersonService.addPerson(PersonService.java:117) ~[classes/:?] at org.gluu.oxtrust.action.RegisterPersonAction.registerImpl(RegisterPersonAction.java:317) ~[classes/:?] at org.gluu.oxtrust.action.RegisterPersonAction.register(RegisterPersonAction.java:224) ~[classes/:?] at sun.reflect.GeneratedMethodAccessor1309.invoke(Unknown Source) ~[?:?] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_222] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_222] ``` **script logs:** ``` 2023-04-17 19:29:55,271 DEBUG [qtp353842779-396635] [org.gluu.oxtrust.service.external.ExternalUserRegistrationService] (ExternalUserRegistrationService.java:52) - Executing python 'preRegistration' method 2023-04-17 19:29:55,271 INFO [qtp353842779-396635] [org.gluu.service.PythonService$PythonLoggerOutputStream] (PythonService.java:240) - User registration. Pre method ``` **oxTrust version:** Manifest-Version: 1.0 Implementation-Title: oxTrust Server Build-Branch: origin/version_4.1.1 Implementation-Version: 4.1.1.Final Archiver-Version: Plexus Archiver Built-By: jetty Implementation-Build: 28a2f16c40d594fd1791ba0cddc807a77db9f348 Implementation-Vendor-Id: org.gluu Created-By: Apache Maven 3.3.9 Build-Jdk: 1.8.0_222 **host:** CentOS Linux release 7.7.1908 (Core)

By Michael Schwartz Account Admin 17 Apr 2023 at 5:04 p.m. CDT

Michael Schwartz gravatar
Public facing oxTrust deployments are discouraged. Our advice is to build a multi-step authentication workflow to accomplish registration. You can do this with an openid parameter like `acr_values=register` or something like that. Then present and process your registration pages with a Person Authn script. This is more secure then opening public web access to oxTrust, where a hacker could try to escalate privileges.

By Mobarak Hosen Shakil staff 24 Apr 2023 at 1:29 a.m. CDT

Mobarak Hosen Shakil gravatar
Hi, Daniel! How many attributes you added in registration field? Regards ~ Shakil

By Mobarak Hosen Shakil staff 23 May 2023 at 1:34 a.m. CDT

Mobarak Hosen Shakil gravatar
Closing this ticket, Please reopen if requires. Thanks!