You are here

interface JsonWebTokenInterface in JSON Web Token Authentication (JWT) 8

Same name and namespace in other branches
  1. 8.0 src/JsonWebToken/JsonWebTokenInterface.php \Drupal\jwt\JsonWebToken\JsonWebTokenInterface

Interface JsonWebTokenInterface.

@package Drupal\jwt\JsonWebToken

Hierarchy

Expanded class hierarchy of JsonWebTokenInterface

All classes that implement JsonWebTokenInterface

4 files declare their use of JsonWebTokenInterface
JwtAuthBaseEvent.php in src/Authentication/Event/JwtAuthBaseEvent.php
JwtAuthValidEvent.php in src/Authentication/Event/JwtAuthValidEvent.php
JwtTranscoder.php in src/Transcoder/JwtTranscoder.php
JwtTranscoderInterface.php in src/Transcoder/JwtTranscoderInterface.php

File

src/JsonWebToken/JsonWebTokenInterface.php, line 10

Namespace

Drupal\jwt\JsonWebToken
View source
interface JsonWebTokenInterface {

  /**
   * Gets the unencoded payload as an object.
   *
   * @return \stdclass
   *   The unencoded payload.
   */
  public function getPayload();

  /**
   * Retrieve a claim from the JWT payload.
   *
   * @param mixed $claim
   *   Either a string or indexed array of strings (if nested) representing the
   *   claim to retrieve. If an indexed array is passed, it will be used to
   *   traverse the JWT where the 0th element is the topmost claim.
   *
   * @returns mixed The contents of the claim.
   */
  public function getClaim($claim);

  /**
   * Add or update the given claim with the given value.
   *
   * @param mixed $claim
   *   Either a string or indexed array of strings representing the claim or
   *   nested claim to be set.
   * @param mixed $value
   *   A serializable value to set the given claim to on the JWT.
   */
  public function setClaim($claim, $value);

  /**
   * Remove a claim from the JWT payload.
   *
   * @param mixed $claim
   *   Either a string or indexed array of strings.
   *
   * @See Drupal\jwt\JsonWebTokenInterface::getClaim().
   */
  public function unsetClaim($claim);

}

Members

Namesort descending Modifiers Type Description Overrides
JsonWebTokenInterface::getClaim public function Retrieve a claim from the JWT payload. 1
JsonWebTokenInterface::getPayload public function Gets the unencoded payload as an object. 1
JsonWebTokenInterface::setClaim public function Add or update the given claim with the given value. 1
JsonWebTokenInterface::unsetClaim public function Remove a claim from the JWT payload. 1