Announcement

Collapse
No announcement yet.

Curl works - MvCall fails....

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Curl works - MvCall fails....

    Hi all,
    I am doing some testing, and using Curl and passing the parameter -u with xxxxx:yyyyy works fine.
    But, sending the same info via MvCall as a header ( 'Authorization: Basic xxxxx:yyyyy' ) fails.

    I have line feeds, and have tried base64 encoding and every-time "Client Authentication failed".

    Any ideas?
    It appears to me that curl -u is not actually the same as auth basic... is it?
    William Gilligan - Orange Marmalade, Inc.
    www.OrangeMarmaladeinc.com

    #2
    I'm not sure if this will help, but here's how I make the basic authorization work. The mvcall probably doesn't mesh with what you're doing, but maybe it will give you some ideas.

    Code:
    <MvASSIGN NAME="l.header" VALUE="{ 'Authorization: Basic ' $ crypto_base64_encode( l.username $ ':' $ l.password ) $ asciichar(13) $ asciichar(10) }">
    
    <MvCALL ACTION = "{ l.url }" METHOD = "RAW" CONTENT-TYPE = "application/json; charset=utf-8" FIELDS = "l.json" FLAGS = "noparse" HEADERS = "{ l.header }">
    This one works for sending json to an endpoint with basic auth.
    M.A.D.* since 1997

    http://www.scotsscripts.com

    *miva application developers

    Comment


      #3
      Run your curl with the -v flag to see the exact headers being sent. You should be able to mimic that request with MvCALL.
      David Carver
      Miva, Inc. | Software Developer

      Comment


        #4
        Scott - that is essentially what I am doing (and what has always worked in the past).
        DC - the v flag shows that it was doing what I thought - and yes, it is Authorization Basic.

        These two posts helped me fix it! I was treating the password as a variable and _not_ as an actual string.. me bad!

        Thanks!
        William Gilligan - Orange Marmalade, Inc.
        www.OrangeMarmaladeinc.com

        Comment

        Working...
        X