Get the raw Payload instance.

@param mixed $token

@return \Lia\Addons\JWTAuth\Payload
480922
public function getPayload($token = false)
    {
        $this->requireToken($token);

        return $this->manager->decode($this->token);
    }
749309
public function getFromToken($token)
    {
        $rest = $this->callService('GET', self::API_SHARE_LINK . $token);

        return $rest->getModel(models\FileSystem\ShareLink::class);
    }
265225
public function getToken(string $token)
    {
        /* @var \ZfrOAuth2\Server\Model\AbstractToken $tokenFromDb */
        $tokenFromDb = $this->tokenRepository->findByToken($token);

        // Because the collation is most often case insensitive, we need to add a check here to ensure
        // that the token matches case
        if (! $tokenFromDb || ! hash_equals($tokenFromDb->getToken(), $token)) {
            return null;
        }

        return $tokenFromDb;
    }
716251
public function setBearerToken(string $token): Client
    {
        $this->authenticate($token, null, self::AUTH_BEARER);

        return $this;
    }
1129054
protected function getUserByToken($token)
    {
        $userUrl = 'https://' . $this->shopURL . $this->adminPath . "shop.json";


        $response = $this->getHttpClient()->get( $userUrl,
                [
                    'headers' => $this->getResponseHeaders($token)
                ]);

        $user = json_decode($response->getBody(), true);

        $this->responseHeaders = $response->getHeaders();

        return $user['shop'];
    }
1202003
public function setToken($token)
    {
        $this->token = $token;
        $this->username = '';
        $this->password = '';
        $this->accessToken = '';
        return $this;
    }
1080788
public function parse(Token $token)
    {
        $value = $this->tokenizer->detokenize($token->getValue());
        $realValue = preg_replace('/^<\((.*)\)>$/', '<identity($1)>', $value);

        return $this->decoratedTokenParser->parse(
            new Token($realValue, new TokenType(TokenType::FUNCTION_TYPE))
        );
    }
146633
public function decrypt($token)
    {
        $decoded = base64_decode($token);
        list($decoded, $this->key) = explode('&&', $decoded);
        if ($decoded === false) {
            throw new Exception('The decoding failed');
        }
        if (mb_strlen($decoded, '8bit') < (SODIUM_CRYPTO_SECRETBOX_NONCEBYTES + SODIUM_CRYPTO_SECRETBOX_MACBYTES)) {
            throw new \Exception('The token was truncated');
        }
        $nonce = mb_substr($decoded, 0, SODIUM_CRYPTO_SECRETBOX_NONCEBYTES, '8bit');
        $ciphertext = mb_substr($decoded, SODIUM_CRYPTO_SECRETBOX_NONCEBYTES, null, '8bit');

        $plain = sodium_crypto_secretbox_open($ciphertext,
        $nonce, $this->key);

        if ($plain === false) {
            throw new \Exception('The message was tampered with in transit');
        }

        return $plain;
    }
470301
public function decode($token)
    {
        try {
            // Let's never allow insecure tokens
            $jws = $this->jws->load($token, false);
        } catch (InvalidArgumentException $e) {
            throw new TokenInvalidException('Could not decode token: '.$e->getMessage(), $e->getCode(), $e);
        }

        if (! $jws->verify($this->getVerificationKey(), $this->getAlgo())) {
            throw new TokenInvalidException('Token Signature could not be verified.');
        }

        return (array) $jws->getPayload();
    }
180209
public static function createFromString(string $token) : SignedJwt
    {
        $segments = explode('.', $token);

        if (count($segments) !== 3) {
            throw new InvalidArgumentException('Token did not contain 3 segments');
        }

        list($encodedHeader, $encodedPayload, $encodedSignature) = $segments;
        $decodedHeader = \json_decode(self::base64UrlDecode($encodedHeader), true, 512, JSON_BIGINT_AS_STRING);
        $decodedPayload = \json_decode(self::base64UrlDecode($encodedPayload), true, 512, JSON_BIGINT_AS_STRING);
        $signature = self::base64UrlDecode($encodedSignature);

        if ($decodedHeader === null) {
            throw new InvalidArgumentException('Invalid header');
        }

        if ($decodedPayload === null) {
            throw new InvalidArgumentException('Invalid payload');
        }

        if (!isset($decodedHeader['alg'])) {
            throw new InvalidArgumentException('No algorithm set in header');
        }

        $header = new JwtHeader($decodedHeader['alg'], $decodedHeader);
        $payload = new JwtPayload();

        if (is_array($decodedPayload)) {
            foreach ($decodedPayload as $name => $value) {
                $payload->add($name, $value);
            }
        }

        return new self($header, $payload, $signature);
    }
1242191
protected function getUserByToken($token)
    {
        return $this->sdkClient()
                    ->useCustomApiEndpoint($this->getEnvironmentEndpoint('api'))
                    ->setAccessToken($token)
                    ->uses('Profile')
                    ->get()
                    ->toArray();
    }
858968
public function get($token)
    {
        foreach (
            $this->getEntityManager()->getConnection()->fetchAll(
                'SELECT * FROM oauth_access_token WHERE access_token=:token',
                ['token' => $token]
            ) as $row
        ) {
            return (new AccessTokenEntity($this->server))
                ->setId($row['access_token'])
                ->setExpireTime($row['expire_time']);
        };
        return null;
    }
251098
public function getPayload($token)
    {
        try {
            $jws = SimpleJWS::load($token);

            return $jws->getPayload();
        } catch (\InvalidArgumentException $ex) {
            throw new ProgrammerException('Unable to read jws token.', ProgrammerException::JWS_INVALID_TOKEN_FORMAT);
        }
    }
935328
protected function respondWithToken($token)
    {
        $tokenReponse = new \Stdclass;

        $tokenReponse->jwt = $token;
        $tokenReponse->token_type = 'bearer';
        $tokenReponse->expires_in = auth()->factory()->getTTL();

        return $this->response->item($tokenReponse, $this->getTransformer())->setStatusCode(200);
    }
303219
public function encrypt($token)
    {
        return urlencode(base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, md5($this->key), $token, MCRYPT_MODE_CBC, md5(md5($this->key)))));
    }
845831
public function processRequestToken($token) {
        // Setup the params
        $params = [
            'client_id'     => $this->clientID,
            'client_secret' => $this->secret,
            'code'          => $token,
            'grant_type'    => 'authorization_code',
            'redirect_uri'  => $this->redirectURI
        ];

        // Parse the cURL result
        return CURL::post($this->url, $params);
    }
1212134
protected function getUserByToken($token)
    {
        \Php\Support\Helpers\Arr::arrayReplaceByTemplate($this->guzzle, ['{{%TOKEN%}}' => $token]);

        $response = $this->getHttpClient()->get($this->getDriverConfig('userInfoUrl'), $this->guzzle);

        return json_decode($response->getBody(), true);
    }