public function getAccessToken($oauth_token) { // just decode the token, don't verify if (!($tokenData = $this->encryptionUtil->decode($oauth_token, null, false))) { return false; } $client_id = isset($tokenData['client_id']) ? $tokenData['client_id'] : null; $private_key = get_private_server_key(); $algorithm = 'RS256'; // now that we have the client_id, verify the token if (false === $this->encryptionUtil->decode($oauth_token, $public_key, true)) { return false; } return $tokenData; }
protected function encodeToken(array $token, $client_id = null) { $private_key = get_private_server_key(); $algorithm = wo_get_algorithm(); return $this->encryptionUtil->encode($token, $private_key, $algorithm); }