User 'admin' login fail

User 'admin' login fail

  
I searched the community and could not find a specific instance of help. Somehow, my Users espace 'admin' login has become invalid. I have tried admin/admin, as well as any password I could have possibly changed it to, and it fails. The only password I have changed was the service studio password, and even that does not work. I have checked the ossys_User table, and the admin user does in fact exist, and does have a password in the field (encrypted, of course). Any ideas on how to fix my situation to be able to get back into the Users espace?
Okay, fixed this one the hard way. Noticed that I only had 1 user existing in the ossys_user table. It was the 'admin' user with tenant_id=1. I figured out that this was for Service Center only. I have no idea how I lost my Users eSpace admin user. I found out from ossys_tenant table that my User eSpace is tenant_id (and espace_id) =7. I imagine this is the default for every install. I also went into my ossys_role table to find all of the roles that existed in my system at the moment.

Next, I added a new user to my ossys_user table, with tennant_id=7, name=Administrator, username=admin, and password=the encrypted text value of my Service Studio admin login. Once the user was inserted, I then inserted a new row into ossys_User_Role for every role_id I found in the ossys_role table, providing user_id as the user I had just created.

Voila! Now I have a new admin user (it gave it user_id of 3, skipping over 2 making me suspicious that I originally had a 2, and somehow it got deleted) with the same password as my Service Center admin password. I successfully logged into my User eSpace with it, and everything seems like it will be okay now (as I gave the user every role in the system so far).

Maybe this can be helpful to someone else someday, or maybe I am just very good at messing things up, and no one else will ever have this problem :-)
You definitely learned it the hard way! Congratulations, I bet you learned some new stuff while fixing this. And thanks for sharing!

I was about to do that same magic the other day, when a fellow colleague at OutSystems reminded me about the User eSpace API actions. If you create a timer, scheduled to 'When Published', then define a bootstrap action to call User_Create action, you'll get a brand new user. Then all you're missing is a reference to User_Role entity and assign it the 'Administrator' role. Voilá!