Get decoded token.
@return StdObject JSON Object
557874
public function getDecoded()
    {
      if (is_null($this->token)) return null;
      if (is_null($this->decoded)) {
        try {
          $this->decoded = JWT::decode($this->token, $this->key, ['HS512']);
        }
        catch (\Exception $e) {}
        catch (\DomainException $e) {}
      }
      return  $this->decoded;
    }
68842
public function getPayloadJSON()
    {
        $data = is_string($this->data) ? mb_convert_encoding($this->data, 'UTF-8') : $this->data;
        return json_encode($data);
    }
200427
public function getDecodedBody(): array
    {
        if ($this->decodedBody === null) {
            $decodedBody = json_decode($this->getBody(), true);
            if ($decodedBody === null || json_last_error() !== JSON_ERROR_NONE) {
                $decodedBody = [];
            }

            $this->decodedBody = $decodedBody;
        }

        return $this->decodedBody;
    }
387910
public function getDecodedBody()
    {
        if (empty($this->decodedBody) || $this->decodedBody === null) {
            //Decode the Response Body
            $this->decodeBody();
        }

        return $this->decodedBody;
    }
1038819
public function getEncoded()
    {
        $data = serialize($this->data);
        if (function_exists('gzdeflate'))
        {
            $data = gzdeflate($data);
        }
        $data = base64_encode($data);
        $data .= $this->signature($data);
        return $data;
    }
996485
public function getJson()
    {
        $json = array(
            'urlKeyParam' => $this->getUrlKeyParam(),
            'inputFieldName' => $this->getTokenInputName(),
            'observedCssRules' => $this->getObservedCssRules(),
            'requestUrl' => $this->getTokenUrl(),
            'cookieName' => $this->getCookieName()
        );

        return json_encode($json);
    }
471790
public function getDecodedToken(string $jwt)
    {
        try {
            /** @noinspection PhpUnusedLocalVariableInspection */
            [$headb64, $bodyb64, $cryptob64] = \explode('.', $jwt);
            $decodedToken = \json_decode(JWT::urlsafeB64Decode($bodyb64));

            /** @noinspection NullPointerExceptionInspection */
            JWT::decode($jwt, $this->findTenant($decodedToken->iss)->getSharedSecret(), ['HS256']);

            return $decodedToken;
        } catch (\Throwable $e) {
            throw new AuthenticationException($e->getMessage());
        }
    }
39530
public function getToken()
    {
        if (! $this->token) {
            try {
                $this->parseToken();
            } catch (JwTException $e) {
                return false;
            }
        }

        return $this->token;
    }
637664
public function invalidateToken()
    {
      $decoded = (array) $this->getDecoded();
      $decoded['data'] = (array) $decoded['data'];
      $this->decoded = null;

      $issuedAt   = time() - $this->expire_after - 7200; // less {expiry} and 2 hours
      $notBefore  = $issuedAt + 10; //Adding 10 seconds - no need, I know
      $expire     = $notBefore + 1; //Adding 1 second - no need, I know

      $decoded["iat"] = $issuedAt;
      $decoded["nbf"] = $notBefore;
      $decoded["exp"] = $expire;


      return $this->token = JWT::encode($decoded, $this->key, 'HS512');

    }
307597
public function decodeFromJson()
    {
        $parsed = json_decode($this->body, true);

        if (is_null($parsed)) {
            throw new UnexpectedResponseFormatException($this);
        }

        return $parsed;
    }
814755
public static function getToken()
	{
		$client     = new Client();
		$body       = ['UserApiKey'=>config('smsir.api-key'),'SecretKey'=>config('smsir.secret-key'),'System'=>'laravel_v_1_4'];
		$result     = $client->post('http://restfulsms.com/api/Token',['json'=>$body,'connect_timeout'=>30]);
		return json_decode($result->getBody(),true)['TokenKey'];
	}
93318
public static function token()
    {
        $token = null;

        if (self::has('server.HTTP_X_TOKEN')) {
            $token = self::get('server.HTTP_X_TOKEN', 'md5');
        }

        if (self::has('request._token')) {
            $token = self::get('request._token', 'md5');
        }

        return $token;
    }
1091527
public function json()
    {
        $field = $this;

        return $this->unescape()->as(function ($value) use ($field) {
            $content = json_decode($value, true);

            if (json_last_error() == 0) {
                $field->border = false;

                return '<pre><code>'.json_encode($content, JSON_PRETTY_PRINT).'</code></pre>';
            }

            return $value;
        });
    }
686836
public function getJSONString()
	{
		$json = '{'
				. '"@context":"' .			SocialRecord::JSONLD_CONTEXT . '",'
				. '"@type":"' .				SocialRecord::JSONLD_TYPE . '",'
				. '"type":"' .				$this->type . '",'
				. '"globalID":"' .			$this->globalID . '",'
				. '"platformGID":"' .		$this->platformGID . '",'
				. '"displayName":"' .		$this->displayName . '",'
				. '"profileLocation":"' .	$this->profileLocation . '",'
				. '"personalPublicKey":"' .	PublicKey::exportKey($this->personalPublicKey) . '",'
				. '"accountPublicKey":"' .	PublicKey::exportKey($this->accountPublicKey) . '",'
				. '"salt":"' .	 			$this->salt . '",'
				. '"datetime":"' .	 		$this->datetime . '",'
				. '"active":' . 			$this->active . ','
				. '"keyRevocationList":[';
				
		foreach($this->keyRevocationList as $krc)
		{
			$json .= $krc->getJSONString();
			if($krc !== end($this->keyRevocationList)) $json .= ',';
		}
		
		$json .= ']}';
		
		return $json;
	}
17209
public function jsonSerialize()
    {
        $payload = self::getDefaultPayloadStructure();

        if ($this->alert instanceof Alert || is_string($this->alert)) {
            $payload[self::PAYLOAD_ROOT_KEY][self::PAYLOAD_ALERT_KEY] = $this->alert;
        }

        if (is_int($this->badge)) {
            $payload[self::PAYLOAD_ROOT_KEY][self::PAYLOAD_BADGE_KEY] = $this->badge;
        }

        if (is_string($this->sound)) {
            $payload[self::PAYLOAD_ROOT_KEY][self::PAYLOAD_SOUND_KEY] = $this->sound;
        }

        if (is_bool($this->contentAvailable)) {
            $payload[self::PAYLOAD_ROOT_KEY][self::PAYLOAD_CONTENT_AVAILABLE_KEY] = (int)$this->contentAvailable;
        }

        if (is_bool($this->mutableContent)) {
            $payload[self::PAYLOAD_ROOT_KEY][self::PAYLOAD_MUTABLE_CONTENT_KEY] = (int)$this->mutableContent;
        }

        if (is_string($this->category)) {
            $payload[self::PAYLOAD_ROOT_KEY][self::PAYLOAD_CATEGORY_KEY] = $this->category;
        }

        if (is_string($this->threadId)) {
            $payload[self::PAYLOAD_ROOT_KEY][self::PAYLOAD_THREAD_ID_KEY] = $this->threadId;
        }

        if (is_countable($this->customValues) && count($this->customValues)) {
            $payload = array_merge($payload, $this->customValues);
        }

        return $payload;
    }
770278
public function getJson()
    {
        $dirty = $this->getDirty();
        if (count($dirty)) {
            $this->internal_original_value = $this->__toString();
        }

        return $this->internal_original_value;
    }
1175962
public function decode($token)
    {
        try {
            $data = JWT::decode($token, $this->secretKey, $this->allowed_algs);
        } catch (\UnexpectedValueException $e) {
            throw new \UnexpectedValueException($e->getMessage());
        } catch (\DomainException $e) {
            throw new \UnexpectedValueException($e->getMessage());
        }

        if ($data->exp < time()) {
            throw new \UnexpectedValueException('token not allowed');
        }

        return $data;
    }