Function parseUnknownJwt

  • Parse a JWT token, validates it and returns the payload. If the token is invalid, the function will return null. This function has an fail-safe mechanism, so it will never throw an error. (Tho it will log a warning if the token is invalid)

    Parameters

    • token: string

      The JWT token to parse

    • Optional jwk: ((protectedHeader?, token?) => Promise<KeyLike>)

      The JWK to validate the token

        • (protectedHeader?, token?): Promise<KeyLike>
        • Parameters

          • Optional protectedHeader: JWSHeaderParameters
          • Optional token: FlattenedJWSInput

          Returns Promise<KeyLike>

    Returns Promise<JwtBase | null>