Uploaded image for project: 'Keycloak'
  1. Keycloak
  2. KEYCLOAK-8663

When calling enforce with no Authorization header Node reports runtime error

    XMLWordPrintable

    Details

      Description

      Using the enforce middleware without Authorization header causes Node to report a runtime error:
      TypeError: Cannot read property 'indexOf' of undefined

      This is caused by:

      if (header && header.indexOf('bearer ') === 0 || header.indexOf('Bearer ') === 0) {

      should be:

      if (header && (header.indexOf('bearer ') === 0 || header.indexOf('Bearer ') === 0)) {

      The return from the enforce function that follows is empty. But the caller is expecting a promise.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                pcraveiro Pedro Igor Silva
                Reporter:
                ulrik.sjolin Ulrik Sjölin
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: