# security.getUserUID problem

**URL:** <https://forum.servoy.com/t/security-getuseruid-problem/14913>\
**Category:** Classic Servoy\
**Created:** [October 24, 2011, 6:46pm UTC](https://forum.servoy.com/t/security-getuseruid-problem/14913 "2011-10-24T18:46:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kurtbleicken](https://avatars.discourse-cdn.com/v4/letter/k/c57346/32.png) [@kurtbleicken](https://forum.servoy.com/u/kurtbleicken)\
**Post date:** [October 24, 2011, 6:46pm UTC](https://forum.servoy.com/t/security-getuseruid-problem/14913/1 "2011-10-24T18:46:10Z")

</div>

Running into an odd problem. The following code adds a new user to the security system then we are retrieving the UserUid using

var UserUUID = security.getUserUID( UserName )

Everything works perfectly on the development computer and a bona fide UserUid is retrieved. But when the solution is on the server we get a UserUID that is a number like 237. Any thoughts on how to fix this? Thanks in advance. K

var UserName = forms.user\_new.userid\_calc  
var Password = forms.user\_new.usr\_password  
security.createUser( UserName, Password )  
var Group = forms.user\_new.usr\_group  
var UserUUID = security.getUserUID( UserName )

---

<div class="post-metadata">

**Author:** ![kurtbleicken](https://avatars.discourse-cdn.com/v4/letter/k/c57346/32.png) [@kurtbleicken](https://forum.servoy.com/u/kurtbleicken)\
**Post date:** [October 25, 2011, 1:08pm UTC](https://forum.servoy.com/t/security-getuseruid-problem/14913/2 "2011-10-25T13:08:44Z")

</div>

More weirdness. Created a new solution with one form. Three form variables, newUser, newPassword and UUIDformvariable

var username = newUser  
var password = newPassword  
security.createUser( username, password )  
var UUID = security.getUserUID( username)  
UUIDformvariable = UUID

This generates a proper UUID, 81464CBF-E6FC-4E93-9CE5-34D2DA85C27E in developer

and generates 146 on the server. If you create another new user it will be 147.

Looks like the UUID generator is broken on the server. Any thoughts on how to fix? K

---

<div class="post-metadata">

**Author:** ![patrick](https://avatars.discourse-cdn.com/v4/letter/p/b2d939/32.png) [@patrick](https://forum.servoy.com/u/patrick)\
**Post date:** [October 25, 2011, 2:17pm UTC](https://forum.servoy.com/t/security-getuseruid-problem/14913/3 "2011-10-25T14:17:09Z")

</div>

In the old times you would get the ID of the user record in the Servoy repository. This was changed because people wanted to be able to manage their own identifiers, wherever they may come from (for example LDAP). So basically the idea is that YOU provide a uid when you create a user (see the last parameter).

Since you do not supply an ID, Servoy server falls back to the old mechanism of giving you the repository ID (an integer). In developer, there is no repository database, so you get a UUID.

---

<div class="post-metadata">

**Author:** ![kurtbleicken](https://avatars.discourse-cdn.com/v4/letter/k/c57346/32.png) [@kurtbleicken](https://forum.servoy.com/u/kurtbleicken)\
**Post date:** [October 25, 2011, 8:12pm UTC](https://forum.servoy.com/t/security-getuseruid-problem/14913/4 "2011-10-25T20:12:38Z")

</div>

Many thanks Patrick. That solves the mystery. K
