security.getUserUID problem

Questions, tips and tricks and techniques for scripting in Servoy

security.getUserUID problem

Postby kurtbleicken » Mon Oct 24, 2011 8:46 pm

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 )
Kurt Bleicken
Servoy 7
Executive Director, onRamp for nonprofits
kurtbleicken@gmail.com
Founder, AgentSphere, LLC
kurtbleicken@gmail.com
603.525.8019
kurtbleicken
 
Posts: 100
Joined: Mon Feb 12, 2007 11:36 pm

Re: security.getUserUID problem

Postby kurtbleicken » Tue Oct 25, 2011 3:08 pm

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
Attachments
testUUID.servoy
(8.75 KiB) Downloaded 269 times
Kurt Bleicken
Servoy 7
Executive Director, onRamp for nonprofits
kurtbleicken@gmail.com
Founder, AgentSphere, LLC
kurtbleicken@gmail.com
603.525.8019
kurtbleicken
 
Posts: 100
Joined: Mon Feb 12, 2007 11:36 pm

Re: security.getUserUID problem

Postby patrick » Tue Oct 25, 2011 4:17 pm

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.
Patrick Ruhsert
Servoy DACH
patrick
 
Posts: 3703
Joined: Wed Jun 11, 2003 10:33 am
Location: Munich, Germany

Re: security.getUserUID problem

Postby kurtbleicken » Tue Oct 25, 2011 10:12 pm

Many thanks Patrick. That solves the mystery. K
Kurt Bleicken
Servoy 7
Executive Director, onRamp for nonprofits
kurtbleicken@gmail.com
Founder, AgentSphere, LLC
kurtbleicken@gmail.com
603.525.8019
kurtbleicken
 
Posts: 100
Joined: Mon Feb 12, 2007 11:36 pm


Return to Methods

Who is online

Users browsing this forum: No registered users and 6 guests