From 128ace9b3d32ae2e8235268c633e755919be2137 Mon Sep 17 00:00:00 2001 From: moesjarraf Date: Thu, 31 Dec 2015 00:53:05 +0100 Subject: [PATCH] Encode tokens with base64 instead of utf8 --- src/Authorizer.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Authorizer.php b/src/Authorizer.php index 82a6e35..2d58e0a 100644 --- a/src/Authorizer.php +++ b/src/Authorizer.php @@ -50,7 +50,7 @@ public static function sign($allowedResource, $authzgen) openssl_public_encrypt($resourceSecret, $encryptedSecret, $publicKey); - return utf8_encode($encryptedSecret); + return base64_encode($encryptedSecret); } /** @@ -63,7 +63,7 @@ public static function sign($allowedResource, $authzgen) */ public static function decrypt($encryptedSecret) { - openssl_private_decrypt(utf8_decode($encryptedSecret), $decryptedSecret, self::getPrivateKey()); + openssl_private_decrypt(base64_decode($encryptedSecret), $decryptedSecret, self::getPrivateKey()); return $decryptedSecret; }