X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModule%2FOwa.php;h=7243c111344b4d159e5fa6d5a86b701936ecd241;hb=be3d7759f029a3000909dd0309fd914e0f70bf04;hp=a1dbfa2f315ea3aa8b31d9f2f12e5ae99854f5b9;hpb=2f28c2ebbfd8f66093d7081d40b1d48f65fcff20;p=friendica.git diff --git a/src/Module/Owa.php b/src/Module/Owa.php index a1dbfa2f31..7243c11134 100644 --- a/src/Module/Owa.php +++ b/src/Module/Owa.php @@ -11,6 +11,7 @@ use Friendica\Database\DBA; use Friendica\Model\Contact; use Friendica\Model\OpenWebAuthToken; use Friendica\Util\HTTPSignature; +use Friendica\Util\Strings; /** * @brief OpenWebAuth verifier and token generator @@ -62,7 +63,7 @@ class Owa extends BaseModule 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']); @@ -74,7 +75,7 @@ class Owa extends BaseModule // 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); } @@ -85,6 +86,6 @@ class Owa extends BaseModule } } } - System::jsonExit($ret, 'application/x-dfrn+json'); + System::jsonExit($ret, 'application/x-zot+json'); } }