Any hidden problems exists if i set CHECK_POLICY = OFF - sql

I have a Store procedure to create auto generate SQl users.
code to create User
CREATE LOGIN userName with PASSWORD= 'autoGeneratedPass'
Problem: When the auto generated Password is weak then i got the below error
Password validation failed. The password does not meet Windows policy requirements because it is too short.
so i turned off Windows policy checking
Code
CREATE LOGIN userName with PASSWORD= 'autoGeneratedPass' CHECK_POLICY = OFF
If i did that any hidden problem arise?

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.

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.

Altering the SQL Username

An example of changing the username is
ALTER USER Mary5 WITH NAME = Mary51;
(from
https://learn.microsoft.com/en-us/sql/t-sql/statements/alter-user-transact-sql?view=sql-server-2017
)
However that requires special permission.
I am looking for a way to change the username from only having the username and password of the same simple user of whom I want to change
such as
ALTER LOGIN ALogin WITH PASSWORD = 'Se6ure?' OLD_PASSWORD = '2Secr#s';
which is an example from https://sqlity.net/en/2322/change-password/.
This means the user themselves can alter their own password without any special permission, I want the same but for usernames.
(I used this as ALTER USER AUser WITH PASSWORD = 'Se6ure?' OLD_PASSWORD = '2Secr#s'; because I'm only altering users, not logins)
So overall, is there any way of altering a username of a user given you have the password and username of the same user and that user hasn't been granted any special permissions?

How do I administratively set a new password for ASP.net Identity User who forgot their password?

I am not looking for a solution that involves the user, a token generated, and emailing in order to reset a user's password.
The scenario is a user contacts the admins and asks them to reset their password (internal organization web app). They are then told what that new temporary password is so they can log in and change it.
I see no function that lets me do the above. My attempt:
string passwordToken = await UM.GeneratePasswordResetTokenAsync(user.Id);
IdentityResult res = await UM.ResetPasswordAsync(user.Id, passwordToken, "newPassword##!$%");
UM is UserManager.
I get error "No IUserTokenProvider is registered". I think GeneratePasswordResetToken is the one causing the error. If so, why?
How do I properly do what I need?
Use the combination of RemovePasswordAsync and AddPasswordAsync
UserManager.RemovePasswordAsync(user.Id);
UserManager.AddPasswordAsync(user.Id, tempPassword);

Username and password injected in my table

I am new to asp.net development
I develop login form with username and password
I finished off with my work but any how my login table has injected with sort of script as
username
"> </title><script src="http://it
password
"> </title><script src="http://it
I have written simple query as
SELECT * FROM user WHERE userid = 'admin' AND password = 'ms2012'
I thought some body has injected in a username and password textbox
But I don't understand how they did. Can anybody explain how they have updated it and what should I do to avoid it?
There are 3 basic things to consider if you want to the application to be secured from SQL Injection:
Paramterized Queries
Stored Procedures
Sanitizing all input data