while making api call in local Machine causes 401 unauthorized!!



  • 0_1651482706886_Screenshot.png


  • administrators

    hi! please provide more details, what version of jsreport are you using? what is the configuration your server is using? do you have the authentication extension enabled? if yes, I don't see in your screenshot that your request includes the required Authorization header



  • {
    "httpPort": 5488,
    "store": {
    "provider": "fs"
    },
    "blobStorage": {
    "provider": "fs"
    },
    "logger": {
    "console": {
    "transport": "console",
    "level": "debug"
    },
    "file": {
    "transport": "file",
    "level": "info",
    "filename": "logs/reporter.log"
    },
    "error": {
    "transport": "file",
    "level": "error",
    "filename": "logs/error.log"
    }
    },
    "allowLocalFilesAccess": true,
    "reportTimeout": 60000,
    "workers": {
    "numberOfWorkers": 2
    },
    "extensions": {
    "authentication": {
    "cookieSession": {
    "secret": "2kxQyJzCc9fyzAd6"
    },
    "admin": {
    "username": "admin",
    "password": "admin"
    },
    "enabled": true
    }
    }
    }



  • 0_1651975784772_SAA.png

    recently i have add authorization header to the api, but i am geting 401 error



  • Try running with the admin user credentials the first.
    The Authorization header in this case should look like
    Basic YWRtaW46YWRtaW4=
    Does this work?


Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.