According to the documentation, hashFunction
accepts 'crypt' as a valid value. My problem is figuring out what type of hash this actually is.
A request with a hash generated by PHPs password_hash function (which I understand uses crypt) fails to work.
The request:
The response:
{
"error": {
"errors": [
{
"domain": "global",
"reason": "invalid",
"message": "Invalid Input: $2y$10$qCE0dkXTyFIg6VmqZ/24AuH0Xo5vb8ce3pX9FhRQn5bJzUnAYLax."
}
],
"code": 400,
"message": "Invalid Input: $2y$10$qCE0dkXTyFIg6VmqZ/24AuH0Xo5vb8ce3pX9FhRQn5bJzUnAYLax."
}
}
(The provided hash is generated from the password "hello").
What's an example of a valid hash that Google will accept?
I believe I've figured it out (example passwords are both hello
):
The accepted hashes are the same type of hash that htpasswd
creates using either -m
or -d
.
Passwords generated with crypt($password)
in PHP will be accepted (if you don't specify a salt), but the newer, more secure password_hash($password)
will not.