Skip to content

Commit

Permalink
Encode tokens with base64 instead of utf8
Browse files Browse the repository at this point in the history
  • Loading branch information
moesjarraf committed Dec 30, 2015
1 parent 79e2402 commit 128ace9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Authorizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public static function sign($allowedResource, $authzgen)

openssl_public_encrypt($resourceSecret, $encryptedSecret, $publicKey);

return utf8_encode($encryptedSecret);
return base64_encode($encryptedSecret);
}

/**
Expand All @@ -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;
}
Expand Down

0 comments on commit 128ace9

Please sign in to comment.