none
Basic authentication with WCF-WebHttp adapter does not work - bizTalk2016 RRS feed

  • Question

  • I am calling below API with operations set

    https://gateway-mbw.abcplatform.net/assist/api/v1/workspaces/12733928sjd234


    <BtsHttpUrlMapping>
     <Operation Name="Operation_1" Method="POST" Url="/payload?version={version}"  />
    </BtsHttpUrlMapping>


    I have Basic Authentication with username and password.

    This settings works great with POSTMAN, not sure why this is being an Issue with BizTalk 2016

    When I am sending with BizTalk I receive : Send Port. Details:"System.Net.WebException: (500) Internal Server Error

    Please advise how to fix this ?


    Just for work around I also tried this : same result 500 errorcode


    For WCF-WebHTTP Adapter, I put my Security as Transport, Credentail Type as Basic provided with Username and Password didnt work, tried with None providing below in Message tab didnt work

    Under Message Tab I tried this and still did not resolve.

    Content-Type:application/json
    Authorization:Basic jdksjdoiwq0mljsjfpwij8DvALiRWHlr1qshdk

    Please advise


    RH

    Monday, September 23, 2019 8:27 PM

Answers

  • Yes, you need to leave Security mode as Transport if you are connecting to https (which you hopefully are otherwise you will be sending credentials in the clear)

    You can leave the Transport client credential type as None:

    • Marked as answer by Dan2890 Tuesday, September 24, 2019 2:38 PM
    Tuesday, September 24, 2019 12:14 AM

All replies

  • The same issue occurred in BizTalk 2013 R2 for some API end points.  As per my blog BizTalk 2013 R2 known bugs, issues & quirks  


    For the HTTP headers You need to have a space between the : and Basic as so.

    Authorization: Basic {auth}

    And where {auth} = Username:Password which is base 64 encoded. 

    e.g If I encode the string  Username:Password it is VXNlcm5hbWU6UGFzc3dvcmQ=

    Your string is not even a Base 64 string, so not valid for the Authorization.

    This is also not a good permanent solution as that is not a secure way of storing the credentials (as anyone who can access the console can take that base64 encoded string and decode it.


    As a fix we created a Endpoint Behaviour that would fetch the credentials from SSO and create the Auth Header when executed.


    Monday, September 23, 2019 10:49 PM
  • so after setting under Message tab I provide as:

    Content-Type: application/json

    Authorization: Basic {auth}

    Do I still need to provide under Security tab as Transport ? and provide Transport Client Credential Type providing with Username their ?

    Or just leave Security tab as Trasnport with Transport Credential Type to None  ?

    Please advise


    RH

    Monday, September 23, 2019 11:55 PM
  • Yes, you need to leave Security mode as Transport if you are connecting to https (which you hopefully are otherwise you will be sending credentials in the clear)

    You can leave the Transport client credential type as None:

    • Marked as answer by Dan2890 Tuesday, September 24, 2019 2:38 PM
    Tuesday, September 24, 2019 12:14 AM
  • Thank you, you are the best

    RH

    Tuesday, September 24, 2019 2:38 PM