Quantcast
Channel: Service Bus forum
Viewing all articles
Browse latest Browse all 1916

MissingToken: Relay security token is required Error With Service Bus Relay Bindign

$
0
0

Hi Team

I am trying to create a WCF service with BasicHttpRelayBinding. Everything works fine if i disable the security, however i am getting fault when security is turned on. Can somebody please help?

Error:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><s:Fault><faultcode xmlns:a="http://schemas.microsoft.com/netservices/2009/05/servicebus/relay">a:AuthorizationFailedFault</faultcode><faultstring xml:lang="en-US">MissingToken: Relay security token is required.</faultstring><detail><AuthorizationFailedFault xmlns="http://schemas.microsoft.com/netservices/2009/05/servicebus/relay" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"/></detail></s:Fault></s:Body></s:Envelope>

Header in Fiddler"

Authorization: WRAP access_token="net.windows.servicebus.action=MytokenValue"
Host: mynamespace.servicebus.windows.net
Content-Length: 729
Content-Type: text/xml
SOAPAction: Operation

Config:

<?xml version="1.0"?>
<configuration>
  
  <system.web>
    <compilation debug="true" targetFramework="4.0" />
  </system.web>
  <system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <behavior name="ServiceBehaviorConfiguration">
          <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
          <serviceMetadata httpGetEnabled="true"/>
          <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="true"/>
        </behavior>
      </serviceBehaviors>
      <endpointBehaviors>
        <behavior name="sharedSecretClientCredentials">
          <transportClientEndpointBehavior credentialType="SharedSecret">
            <clientCredentials>
              <sharedSecret issuerName="owner" issuerSecret="mySecret" />
            </clientCredentials>
          </transportClientEndpointBehavior>
          <serviceRegistrySettings discoveryMode="Public" />
        </behavior>
      </endpointBehaviors>
    </behaviors>
    <services>
      <!-- Note: the service name must match the configuration name for the service implementation. -->
      <service name="InitCallService.InitService" behaviorConfiguration="ServiceBehaviorConfiguration">
        <endpoint name="RelayEndpoint" address="https://mynamespace.servicebus.windows.net/A/Service.svc" binding="basicHttpRelayBinding" bindingNamespace="http://services.company.com/A" bindingConfiguration="RelayEndpointConfig" behaviorConfiguration="sharedSecretClientCredentials" contract="InitCallService.IInitCallService" />

      </service>
    </services>
    <bindings>
      <basicHttpRelayBinding>
        <binding name="RelayEndpointConfig">
          <!--<security relayClientAuthenticationType="None" />-->
          <security relayClientAuthenticationType="RelayAccessToken" mode="Transport" />
        </binding>
      </basicHttpRelayBinding>
    </bindings>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="false">
      <serviceActivations>
        <add factory="System.ServiceModel.Activation.ServiceHostFactory" relativeAddress="./InitCallService.svc" service="InitCallService.InitService"/>
      </serviceActivations>
    </serviceHostingEnvironment>
  </system.serviceModel>
 <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>
  
</configuration>

Thanks

Deepak Sanghi


Deepak Sanghi Happy Biztalking.........


Viewing all articles
Browse latest Browse all 1916

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>