can not edit a value of a binary row in sql - sql

hi i forget admin password but i can connect to sql
i try to replace another user password to recover
but got this error:
the pass field is like this :

Are you looking for this?
UPDATE [my_users_table]
SET [pas] = CAST('newpass' AS VARBINARY(MAX))
WHERE [nam] = 'admin'
Open new window and try to set the password like this. Anyway, if the data is encrypted and then stored as binary, you will first need to get a valid encrypted binary before setting the new password.
UPDATE [my_users_table]
SET [pas] = 0x0DE3446D8F782E9B
WHERE [nam] = 'admin'

Related

Create user in Readers Account Snowflake

I have created a share and added that share to a reader account.
Now I have executed a create user statement there in the reader account i.e.
CREATE or replace USER client_test
PASSWORD = 'Client4321'
LOGIN_NAME = 'client'
DISPLAY_NAME = 'client test'
FIRST_NAME = 'client'
LAST_NAME = 'test'
EMAIL = 'mukul.kumar#gmail.com'
DEFAULT_ROLE = sysadmin;
This statement gets executed without any error and also I can see the user details under the account tab in snowflake UI
but still, when I am trying to login into this newly created user, there is an error of incorrect username or password coming up.
Is creating a user in a reader account not allowed or anything like there in snowflake?
I haven't found documentation on this as such. It will be appreciated if anyone helps me out with this.
The issue here is that the login_name is the one which should be used for logging in to the SF application. Use "client" and "Client4321" to login and it will be successful.

Pimcore password datatype in class

I am trying to use the Pimcore password datatype. It is working fine and the password is stored as encrypted data.
Now I need to check the correct username and password. I could not match the encrypted password. I want to get the username and password using an API request. If the username and the password is correct then return value.
The password is hashed before it is stored to the database. Have a look at the password class within this path:
pimcore/models/DataObject/ClassDefinition/Data/Password.php
If you want to compare the hashed password within the database then use the functions of the password datatype. The password to compare also has to be hashed.
Have a closer look on the functions calculateHash() and verifyPassword() within the class. You should be able to compare passwords by using those functions.
Here is an example :
$user = User::GetByEmail($email, ['limit' => 1, 'unpublished' => false]);
$classDefinition = ClassDefinition::getById(User::classId());
/** #var \Pimcore\Model\DataObject\ClassDefinition\Data\Password $passwordFieldDefinition */
$passwordFieldDefinition = $classDefinition->getFieldDefinition('password');
$verified = $passwordFieldDefinition->verifyPassword($password, $user, false);

How to disable the property of password-generator in OpenDJ

By default, the value of password-generator in Default Password Policy is Random Password Generator, and then if I try to set a password for a user, I'll get an error shows I cannot provide a password.
But in my case, I want the user can set his/her initial password when the account is created. So, how can I disable the property and just let user set the password?
The password-generator is only used when trying to set or change a password with ldappasswordmodify and no new password is passed as parameter.
If you are getting an error when trying to set a password for a user, it is not due to the password-generator. It's something else, and the error message that you can find in the Access log should be pretty explicit.

How do I correctly use the WHERE clause?

I'm currently attempting to manually remove 2FA for my GitLab server's administrator account, since I've lost access to both my OTP app, and the recovery keys for the account.
There is only one account with administrator access.
According to this comment, the correct way to do this is to set otp_required_for_login to false for that user.
I have found my way into the database debug console (sudo gitlab-rails dbconsole; it's basically a wrapper for psql), and am now trying to actually change the value. However, I get a syntax error when running my query.
My query:
UPDATE "users"
SET "otp_required_for_login" = false
WHERE username = "gl_administrator";
The syntax error I get:
ERROR: syntax error at or near ""gl_administrator""
LINE 3: WHERE username = "gl_administrator";
^
You must use single-quotes when referencing a string literal.
So, your query would simply change to:
WHERE username = 'gl_administrator';

Change user password in child system remotely from CUA

I am trying to find a solution which will allow me to change a user's password from our Central User Administration (CUA) system where the user's access and password is on the child system.
I tried to use BAPI_USER_CHANGE with destination call but it doest suit in my case.
(we locked change password function in child systems). This is my code with destination call
CALL FUNCTION 'BAPI_USER_CHANGE'
DESTINATION 'CLNT_500'
EXPORTING
username = p_bname
password = wa_password
passwordx = wa_passwordx
TABLES
return = it_return.
Any suggestions welcome.
We tried to do something similar a while ago, and we ended up doing it in two steps:
BAPI_USER_CHANGE sets an initial password for the user
SUSR_USER_CHANGE_PASSWORD_RFC sets a productive password. It needs the old password as a parameter, that's why we needed to call BAPI_USER_CHANGE first.