Uploaded image for project: 'Red Hat 3scale API Management'
  1. Red Hat 3scale API Management
  2. THREESCALE-3968

JWT_Claim_policy: Issues when the JWT_CLAIM contains special chars

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • None
    • None
    • Gateway
    • Not Started
    • Not Started
    • Not Started
    • Not Started
    • Not Started
    • Not Started
    • +

      User reports that when a liquid JWT contains special chars is impossible to match something because liquid value does not match correctly.

      {
        "https://api.valiue.com/roles": [
          "openid",
          "profile",
          "email",
          "COMMON_EXCEPTIONHANDLER_READER",
          "COMMON_EXCEPTIONHANDLER_READER",
          "COMMON_EXCEPTIONHANDLER_UPDATER"
        ],
        "iss": "https://xxxx/",
        "sub": "xxx",
        "iat": 1574350089,
        "exp": 1574357289,
        "azp": "xxxx",
        "scope": "openid profile email"
      }
      

      I made this snippet, and I can confirm that it's not working as expected:

      context = {}
      context["test/foo"] = ooo
      context.eloy = "123"
      context.foo = "123"
      context.ooo = "omer"
      
      local Liquid = require 'liquid'
      
      -- template to render
      local document = 'hi {{foo}} :: {{- test/foo -}}'
      -- variable to render
      local var = {["name"] = "tobi" }
      
      local template = Liquid.Template:parse(document)
      
      

              Unassigned Unassigned
              eloycoto Eloy Coto (Inactive)
              Eloy Coto Eloy Coto (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: