function apigee_edge_existing_developer_registration_hash in Apigee Edge 8
Generates a token for an email address that is already taken on Apigee Edge.
We do not want to enforce a user to use the same first name, last name, username when this token is generated and when they re-open the registration form by clicking on the link (that includes this token) from the verification email. Therefore we only use the email address for token generation.
Based on user_pass_rehash().
Parameters
\Drupal\user\UserInterface $account: User object.
string $timestamp: Timestamp for seed.
Return value
string Generated token.
2 calls to apigee_edge_existing_developer_registration_hash()
- apigee_edge_existing_developer_registration_hash_validate in ./
apigee_edge.module - Validates token for a registration with an existing developer email on Edge.
- _apigee_edge_existing_developer_email_verification_link in ./
apigee_edge.module - Generates an URL to confirm identity of a user with existing developer mail.
File
- ./
apigee_edge.module, line 1011 - Copyright 2018 Google Inc.
Code
function apigee_edge_existing_developer_registration_hash(UserInterface $account, string $timestamp) {
$data = $account
->getEmail();
$data .= $timestamp;
// TODO Should we increase entropy by generating a random value for an email
// address and temporary storing it with State API?
return Crypt::hmacBase64($data, Settings::getHashSalt());
}