Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Revisions: Issue #46301 All Revisions ] Back to Issue ]
Summary 0046301: Printing of images referring to URLs with authentication is not supported in HWM
Revision 2021-04-19 23:04 by rtoledano
Description We have a client (Weldom), who has a custom module, which during the synchronization of a ticket consults an external service that can return a list of URLs referring to bonds (in image format) as royalties for the purchase made.

The requirement is to be able to print on the printer in addition to the ticket, the generated bonds to be able to give them to the buyer.

Each URL refers to an image so it is possible, for example, to send the following template to print on the printer:

      <? xml version = "1.0" encoding = "UTF-8"?>
      <output>
        <ticket>
          <line>
            <image type = "url">https://wspreprod.be-one.fr/BEOneDataWeldom/tickets/tickets-a645-1617941657970.bmp</image> [^]
          </line>
        </ticket>
       </output>

Which works fine if this URL is not protected by some HTTP authentication method. But this URL is protected with a basic HTTP authentication method. If we try to send the following template to print:
    
      <? xml version = "1.0" encoding = "UTF-8"?>
      <output>
        <ticket>
          <line>
            <image type = "url"> https://<user>:<password>@wspreprod.be-one.fr/BEOneDataWeldom/tickets/tickets-a645-1617941657970.bmp</image> [^]
          </line>
        </ticket>
       </output>
    
    replacing <user> and <password> with the authentication credentials, the image is still not possible to print, due to the way the HWM tries to download this image for printing. The other drawback of trying to solve the problem in this way is that we would be exposing unencrypted authentication data.

     Currently in the source file of the HWM, com.openbravo.pos.printer.TicketParser is where the way to read this image is implemented:
       
        image = ImageIO.read (new URL (text.toString ()));
     
     where text is the URL.

     The use of the java URL class is what prevents the authentication data from being taken into account.
Revision 2021-04-19 22:55 by rtoledano
Description We have a client (Weldom), who has a custom module, which during the synchronization of a ticket consults an external service that can return a list of URLs referring to bonds (in image format) as a royalty for the purchase made.

The requirement is to be able to print on the printer in addition to the ticket, the generated bonds to be able to give them to the buyer.

Each URL refers to an image so it is possible, for example, to send the following template to print on the printer:

      <? xml version = "1.0" encoding = "UTF-8"?>
      <output>
        <ticket>
          <line>
            <image type = "url">https://wspreprod.be-one.fr/BEOneDataWeldom/tickets/tickets-a645-1617941657970.bmp</image> [^]
          </line>
        </ticket>
       </output>

Which works fine if this URL is not protected by some HTTP authentication method. But this URL is protected with a basic HTTP authentication method. If we try to send the following template to print:
    
      <? xml version = "1.0" encoding = "UTF-8"?>
      <output>
        <ticket>
          <line>
            <image type = "url"> https://<user>:<password>@wspreprod.be-one.fr/BEOneDataWeldom/tickets/tickets-a645-1617941657970.bmp</image> [^]
          </line>
        </ticket>
       </output>
    
    replacing <user> and <password> with the authentication credentials, the image is still not possible to print, due to the way the HWM tries to download this image for printing. The other drawback of trying to solve the problem in this way is that we would be exposing unencrypted authentication data.

     Currently in the source file of the HWM, com.openbravo.pos.printer.TicketParser is where the way to read this image is implemented:
       
        image = ImageIO.read (new URL (text.toString ()));
     
     where text is the URL.

     The use of the java URL class is what prevents the authentication data from being taken into account.


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker