Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Andreas Schønau 9 posts 79 karma points
    Aug 24, 2016 @ 14:17
    Andreas Schønau
    0

    Access to content requiring login?

    Hi

    I recently successfully installed pdf creator on my development server. I would like to use it to create custom reports, including charts that are build on the fly.

    On my local machine this seems to work fine, simply by refering to the url of the chart:

    <fo:external-graphic src="@tmpurl"  />
    

    But when I try to run it on my development server, which requires a browser login, the charts will not show up. I checked that the url is correct and I can see the chart by copying the url from the xml into the browser. (I get the full path starting with http://...)

    I asume that the problem is related to pdf-creator trying to access the image in a way where the login information is not available. Does this sound right and is there a way to give pdf-creator access to content that require browser login?

    Hope you can help, Andreas

  • Andreas Schønau 9 posts 79 karma points
    Aug 29, 2016 @ 11:59
    Andreas Schønau
    0

    I have whitelisted the server ip in the UaaS backend, but still having the same issue.

    Any ideas?

  • Darren Ferguson 1022 posts 3259 karma points MVP c-trib
    Aug 30, 2016 @ 08:00
    Darren Ferguson
    0

    Hi Andreas.

    Could you try including the graphic with a "file" URL:

    e.g.

    file:///c:/temp/path/to/my/image.jpg

    You could get the path using something like:

    @Path.Combine(Server.MapPath("/"), "/media/my/file.jpg"))

    This should work!

  • Andreas Schønau 9 posts 79 karma points
    Aug 30, 2016 @ 11:06
    Andreas Schønau
    0

    Hi Darren

    Thanks for helping me out.

    I can get your proposed solution to work with static images, but I need to include a dynamically build chart generated by processing a cshtml file on the webserver. I don't think your proposed solution will work for this scenario.

    Any other ideas? - it works perfectly running on localhost.

    Best regards, Andreas

  • Darren Ferguson 1022 posts 3259 karma points MVP c-trib
    Aug 30, 2016 @ 11:48
    Darren Ferguson
    0

    Assuming that uaas is using basic auth you can make a request like:

    http://username:[email protected]/

    but obviously that involves storing a username password config somewhere in config...

  • Andreas Schønau 9 posts 79 karma points
    Aug 30, 2016 @ 13:00
    Andreas Schønau
    0

    Hi Darren

    Good idea, but still not working... (with our without whitelisting the IP)

    In Chrome i can add the username and password to the url and bypass the login just fine. The information is removed from the login and the chart shows up just fine.

    It won't work in Edge, and Firefox promts me with a dialogue asking for confirmation to log in before showing the chart.

    PDF creator shows an empty spot...

    I don't know if it makes a difference, but my username is an email adress and hence includes '@'

    Best regards, Andreas

  • Darren Ferguson 1022 posts 3259 karma points MVP c-trib
    Aug 30, 2016 @ 13:03
    Darren Ferguson
    0

    Hi Andreas,

    I'm afraid that we move outside of supporting PDF creator here and into supporting the infrastructure.

    I'm afraid I can't suggest another solution, you may need to speak to uaas support about removing the password protection from certain URLs.

Please Sign in or register to post replies

Write your reply to:

Draft