1

I have an Azure Hybrid Connection that's supposed to connect to some on-prem service and expose it to my app services. However, the setup is failing somewhere, and I'm trying to narrow down exactly what the problem is.

As part of this process (and because it would be useful to me in the future) I'm trying to make a call to the underlying on-prem service using SoapUI, but the initial GET request that's supposed to give me the WSDL is instead giving me an authentication error:

GET https://my-relay.servicebus.windows.net/my-endpoint/my-service.svc?wsdl

{
  "error": {
    "code": "TokenMissingOrInvalid",
    "message": "MissingToken: Relay security token is required. TrackingId:b58c004c-e0e6-4dd0-a233-e0d304795e4e_G21, SystemTracker:my-relay.servicebus.windows.net:my-endpoint/my-service.svc, Timestamp:2019-03-05T10:17:26"
  }
}

From where do I get the Relay security token, and how do I tell SoapUI about it?

Tomas Aschan
  • 58,548
  • 56
  • 243
  • 402

2 Answers2

0

This guide may give you the answers you need.

https://www.soapui.org/soap-and-wsdl/authenticating-soap-requests.html

I suspect your normal app automatically accesses the webservice as the current user on the current system. If so, I believe you should look at the NTLM authentication.

Steen
  • 853
  • 5
  • 12
0

You need to create a security token and pass it in the header of your request.

Something like this:

 var tokenProvider = TokenProvider.CreateSharedAccessSignatureTokenProvider(KeyName, Key);
        var uri = new Uri(string.Format("https://{0}/{1}", RelayNamespace, ConnectionName));
        var token = (await tokenProvider.GetTokenAsync(uri.AbsoluteUri, TimeSpan.FromHours(1))).TokenString;
        var client = new HttpClient();
        var request = new HttpRequestMessage()
        {
            RequestUri = uri,
            Method = HttpMethod.Get,
        };
        request.Headers.Add("ServiceBusAuthorization", token);
        var response = await client.SendAsync(request);

For SOAPUI, you would add the resultant token value in a header named "ServiceBusAuthorization."

joshhan
  • 1
  • 1