Jump to content
We've recently updated our Privacy Statement, available here ×

JR IO: Basic authentication not working for JSON (web) data adapter


glen.blokker_1

Recommended Posts

Basic authentication doesn't seem to work for the JSON (web) data adapter. It always returns 403, like it is not including the username and pass that I provided. I only get it working when I manually encode the username + pass and add them as an authorization header value.

What I need:

- Dynamically set the username, pass and request url when generating the report. I do so by defining the values and assigning them to properties using parameters as shown below:
    <parameter name="report_data_location" class="java.lang.String" evaluationTime="Early">
        <property name="net.sf.jasperreports.http.data.url"/>
        <defaultValueExpression><![CDATA["some_url"]]></defaultValueExpression>
    </parameter>
    <parameter name="report_data_user" class="java.lang.String" isForPrompting="false" evaluationTime="Early">
        <property name="net.sf.jasperreports.http.data.username"/>
        <defaultValueExpression><![CDATA["some_username"]]></defaultValueExpression>
    </parameter>
    <parameter name="report_data_pass" class="java.lang.String" isForPrompting="false" evaluationTime="Early">
        <property name="net.sf.jasperreports.http.data.password"/>
        <defaultValueExpression><![CDATA["some_pass"]]></defaultValueExpression>
    </parameter>

I have tested my endpoint using a third party client verifying the basic authentication security on this endpoint. I have also tried to set the username and pass directly into the data adapter but that also doesn't seem to work. It still returns the same 403 error.

Is there some setting or so that I still need to set before basic authentication is available or do I have a mistake in my setup?

Thanks in advanced,

Glen

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...