phalcon/cphalcon · error · InvalidAudience

Invalid Audience

Error message

Invalid Audience

What it means

Error "Invalid Audience" thrown in phalcon/cphalcon.

Source

Thrown at phalcon/Encryption/Security/JWT/Builder.zep:267

     * "aud" claim when this claim is present, then the JWT MUST be
     * rejected.  In the general case, the "aud" value is an array of case-
     * sensitive strings, each containing a StringOrURI value.  In the
     * special case when the JWT has one audience, the "aud" value MAY be a
     * single case-sensitive string containing a StringOrURI value.  The
     * interpretation of audience values is generally application specific.
     * Use of this claim is OPTIONAL.
     *
     * @param mixed $audience
     *
     * @return static
     * @throws ValidatorException
     */
    public function setAudience(var audience) -> <static>
    {
        var aud;

        if typeof audience !== "string" && typeof audience !== "array" {
            throw new InvalidAudience();
        }

        if typeof audience === "string" {
            let aud = [audience];
        } else {
            let aud = audience;
        }

        return this->setClaim(Enum::AUDIENCE, aud);
    }

    /**
     * Sets the content type header 'cty'
     *
     * @param string $contentType
     *
     * @return static
     */

View on GitHub (pinned to b7419de9cd)

When it happens

Trigger: Thrown at phalcon/Encryption/Security/JWT/Builder.zep:267 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of phalcon/cphalcon@b7419de9cd (2026-08-21). Data as JSON: /api/errors/cd92321a1970e0a0. Report an issue: GitHub.