Forum

The forum is a free service supported by community members. Please consider opening a support ticket if you need timely help.

PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 19 May 2020 02:16 PM by  Steve L
Product Variant Web Request
 11 Replies
Sort:
You are not authorized to post a reply.
Page 1 of 3123 > >>
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:2937
    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:2937
    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
    You are not authorized to post a reply.
    Page 1 of 3123 > >>