Difference between setIdentity and setCredential in Zend Framework - zend-framework

What is the difference between setIdentity and setCredential in Zend Framework?
$authAdapter->setIdentityColumn('username')
->setCredentialColumn('password');
$authAdapter->setIdentity($data['username'])
->setCredential($data['password']);
Please help me I need some detailed explanation.

identityColumn: This is the name of the database table column used to represent the identity. The identity column must contain unique values, such as a username or e-mail address.
credentialColumn: This is the name of the database table column used to represent the credential. Under a simple identity and password authentication scheme, the credential value corresponds to the password. See also the credentialTreatment option.
Basically, setIdentity tells the system to set a username and setCredential tells the system to set the provided password for authentication.
Hope it helps.
Ref: Zend Table

Related

Laravel 5.1 Reset Password Function; user's email is in a different table

I have a question regarding Laravel's Reset Password function. I have thoroughly searched for a possible solution and could not find one. Moreover, I tried to scrutinize the code and manually implement it, but failed miserably because of the nesting. (I'm new to Laravel).
According to Laravel's documentation, the user's email must be in the table user in order to work and the error code confirms it.
*Column not found: 1054 Unknown column 'email' in 'where clause' (SQL: select * from user where email = usermail#provider.com limit 1*
However, we do have the scenario that an user might have multiple email addresses, hence stored in a different table called user_email.
Does anybody have experience with this scenario and could take the time to enlighten me on this?
You have two Options:
Write your own password recovery system.
Let the user choose a primary e-mail and make a column on the users table which represents the primary e-mail adresse.

How to do password validation in oracle forms 6i to restrict to enter atleast 1 Capital Letter 1 Number 1 Special Character

How to Restrict Password Field in oracle Forms 6i?
In Password Field user should enter At Least one of the following:
one Capital Letter
one Number
one Special Character
Should I write Trigger code for that or is there any possibility to change in property palette?
Is it an Oracle database account password?
If yes, set this validation using PROFILE. See http://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_6010.htm for detail. You can write own validation function and set it by profile.
If no, use WHEN-VALIDATE-ITEM trigger on your password item. In property palette you can't set it.

How to authenticate with Entity Framework

I have an Entity Framework model that contains the tables
apsnet_Users
aspnet_Memberships
I want to check for the validation of username, and password in WCF library how to achieve that
Shall I add membership to the app.config, how to achieve something like that?
Best regards
A basic (but secure) username/password database should have columns something like this:
UserName - Text
PasswordSalt - Binary
PasswordHash - Binary
The user name can be stored as plain text.
The salt is a random string of bytes, preferably at least as long as the hash.
The password hash is the binary hash of the password + salt.
Here is the basic procedure when giving a user a new password. I will use SHA-256 hashing as an example.
Convert the desired password into a byte array.
Use a CSPRNG to generate another byte array, 32 bytes long. This is the salt.
Add the salt to the end of the password byte array.
Hash the password with SHA-256.
Store the salt in the database.
Store the password hash in the database.
Then when a user enters their password when logging in, this is the procedure.
Look up the user in the database.
Convert the entered password into a byte array.
Add the salt from the database to the end of the password byte array.
Hash the password with SHA-256.
If the hash matches the hash in the database, the password was correct.
This method of password authentication is the preferred method for high-security applications. It is not slow, nor very hard to implement. The best thing is, you can give the entire password table to anyone you please, and the most they will be able to do is pick a user and start guessing passwords.
I failed to use entity framework, and the other algorithms of authontications, so I used Membership with SQL directly , Microsaoft encrypt bu way so hard to retrieve

SugarCRM user password

I've created a user in SugarCRM; once I've created a user the password is mailed to the user.
I see the table user, but the user_hash is blank.
Where does it store the password before it sends an email?
Check the column 'system_generated_password'. 'user_hash' will be null until the new user logs in with the the system generated password and then creates a new password for themselves.
I think you might be mistaken. I just created a new user with a user name new_user. I then did the following query:
SELECT * FROM users WHERE user_name = "new_user"
The user_hash has a value of 1e3fab09c625a96334d18d2da27dae46.
I double-checked, and the password emailed to me was l7YaR7, which md5 hashes to the above.
I did this in Sugar 6.1.1. What version are you using?
Also, did the email get sent out? It's possible that the password hash isn't sent to the DB until after the email has been successfully sent.
You can create user using md5 function if you using phpmyadmin.
You can alter the passworld and use md5() function;

Validating SSN,Email and Phone number in Postgres

Could anyone help me on how to perform validation on SSN, Email, phone through a stored procedure in Postgresql?
Thanks.
A stored procedure doesn't look like the right solution. Use a domain with a check constraint using pattern matching. There is an example on the CREATE DOMAIN reference page. For email address checking, consider http://wiki.postgresql.org/wiki/Email_address_parsing.