Skip to content

Commit

Permalink
Merge pull request #8 from legalthings/base64-encoded-tokens
Browse files Browse the repository at this point in the history
Encode tokens with base64 instead of utf8
  • Loading branch information
moesjarraf committed Dec 31, 2015
2 parents 79e2402 + 128ace9 commit 90cb3f4
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 90cb3f4

Please sign in to comment.