use Friendica\Model\Contact;
use Friendica\Model\OpenWebAuthToken;
use Friendica\Util\HTTPSignature;
+use Friendica\Util\Strings;
/**
* @brief OpenWebAuth verifier and token generator
Logger::log('OWA success: ' . $contact['addr'], Logger::DATA);
$ret['success'] = true;
- $token = random_string(32);
+ $token = Strings::getRandomHex(32);
// Store the generated token in the databe.
OpenWebAuthToken::create('owt', 0, $token, $contact['addr']);
// At a later time, we will compare weather the token we're getting
// is really the same token we have stored in the database.
openssl_public_encrypt($token, $result, $contact['pubkey']);
- $ret['encrypted_token'] = base64url_encode($result);
+ $ret['encrypted_token'] = Strings::base64UrlEncode($result);
} else {
Logger::log('OWA fail: ' . $contact['id'] . ' ' . $contact['addr'] . ' ' . $contact['url'], Logger::DEBUG);
}
}
}
}
- System::jsonExit($ret, 'application/x-dfrn+json');
+ System::jsonExit($ret, 'application/x-zot+json');
}
}