Go to previous topic
Go to next topic
Last Post 19 May 2020 02:16 PM by  Steve L
Product Variant Web Request
 11 Replies
Author Messages


New Member


Posts:22
New Member


--
28 Mar 2020 01:46 PM
    Hi,

    I would like to make a web request for a product variant. I need to use basic authentication for the web request. The form on the store front does not allow me to do this, nor does the custom action example. Please can you let me know how I can set this up.

    Steven
    0


    Veteran Member


    Posts:2955
    Veteran Member


    --
    01 Apr 2020 02:49 PM

    Hi Steven

    A basic request you can simply preceed the URL with the user:password separated by a @ sign as shown below.

    https://user:password@www...ample.com/index.html

    If you need something more complex, you can use the custom rule.

    0


    New Member


    Posts:22
    New Member


    --
    01 Apr 2020 03:34 PM

    Stephen,

    Thanks for the reply.

    I have tried this approach (testing with both Postman and Chrome) and it does not work. If I set the authorisation header it works, but not as username:password in the URL.

    This maybe because the method is depreciated (https://developer.mozilla.../HTTP/Authentication), or Azure where the API is hosted does not accept this type of connection. The error message is failure to connect, so I don't think it is anything to do with the API itself.

    Do you have any guidance on how I can include a Basic Auth header in a custom rule. If I can get pointed in the right direction on this, I'm sure I can do the rest.

    Steven

    0


    Veteran Member


    Posts:2955
    Veteran Member


    --
    02 Apr 2020 04:09 PM

    Have you tried specifying https://user:pwd@url.com/path in the rule? The Storefront transmits the request differently than browsers/postman. The browser will strip off the authorization before sending, but the Storefront does not.

    0


    New Member


    Posts:22
    New Member


    --
    03 Apr 2020 02:15 PM

    Did not work as well. This is my action:

    <xsl:transform version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

    <xsl:template match="/">
    <out>
    <webRequest>
    <url>https://********:********@mcerestapi.azurewebsites.net/cablecredits/purchase/2/10</url>
    <method>PUT</method>
    <timeout>30000</timeout>
    </webRequest>
    </out>
    </xsl:template>
    </xsl:transform>


    0


    Veteran Member


    Posts:2955
    Veteran Member


    --
    03 Apr 2020 06:29 PM

    Hi Steven

    We performed some internal tests to query a Basic Auth URL and you are correct that it doesn't work with that format anymore. The current release also supports POST and GET methods only.

    I have discussed with our team and we will enhance the Custom Rule by supporting new fields in the next release v15.9 and support the PUT and DELETE methods as well. The next release is due out early next week.

    The new fields will look like this:

    <webRequest>
    <url></url>
    <username></username>
    <password></password>
    <domain></domain>
    <method></method>
    <postString></postString>
    <timeout></timeout>
    </webRequest>

    Thank you for your patience.

    0


    New Member


    Posts:22
    New Member


    --
    03 Apr 2020 06:48 PM

    Thanks for the reply.

    Currently I am using 15.2.0. Would 15.9 be a free upgrade or paid?

    Steven

    0


    Veteran Member


    Posts:2955
    Veteran Member


    --
    03 Apr 2020 06:49 PM

    It would be a free upgrade.

    0


    New Member


    Posts:22
    New Member


    --
    18 May 2020 10:19 AM

    Stephen,

    It's been a little while. Is there a time-frame for when the update will be done?

    Steven

    0


    Veteran Member


    Posts:2955
    Veteran Member


    --
    18 May 2020 04:30 PM

    Hi Steven

    Yes, sorry I forgot to post back here. It should already be available since v15.9 (see release notes that mentions "Allow place order action to submit web request with basic authentication."). For the v15 series, we are already at v15.12.

    Note, we also have released v16 series, but this requires a paid license upgrade.

    Thanks!

    0


    New Member


    Posts:22
    New Member


    --
    19 May 2020 11:31 AM

    Thanks Stephen.

    I will installed the 15.12 and try it out.

    Currently I am using DNN 9.3.2. If I upgrade to DNN 9.6.1 will StoreFront 15.12 and Wiki 4.1.0 still work?

    Steven

    0


    Veteran Member


    Posts:2955
    Veteran Member


    --
    19 May 2020 02:16 PM

    Yes that should work. As usual, make sure to take a quick backup before doing any kind of upgrade.

    0


    ---