Servce Bus Token has an invalid signature

I am trying to create a service bus relay based on this article

An error message appears Generic: InvalidSignature: the token has an invalid signature.

static void Main(string[] args)
{
        ServiceHost sh = new ServiceHost(typeof(ProblemSolver));

        sh.AddServiceEndpoint(
           typeof(IProblemSolver), new NetTcpBinding(),
           "net.tcp://tjservicebus.servicebus.windows.net/solver");

        Console.WriteLine("Add Binding End Point");

        var key = "MYKEY";

        sh.AddServiceEndpoint(
           typeof(IProblemSolver), new NetTcpRelayBinding(),
           ServiceBusEnvironment.CreateServiceUri("sb", "tjservicebus", "solver"))
            .Behaviors.Add(new TransportClientEndpointBehavior
            {
                TokenProvider = TokenProvider.CreateSharedAccessSignatureTokenProvider("RootManageSharedAccessKey", key)
            });

        sh.Open();

        Console.WriteLine("Press ENTER to close");
        Console.ReadLine();

        sh.Close();
    }

An error message appears at sh.Open ();

Can anyone help?

+4
source share
2 answers

It looks like I made out the problem, the slash in the key could not be avoided

Next problem: now I get the following, but I want to exclude our firewall first.

<Error>
  <Code>400</Code>
    <Detail>
      Cannot send message because the service endpoint hosted at the specified address uses a binding that cannot be accessed over HTTP. TrackingId:7e6402e1-a250-482b-967e-a4d1860bca54_G37,TimeStamp:11/12/2015 9:09:15 AM
    </Detail>
</Error>
0
source

I encountered the same error as your first.

, . SharedAccessKey , .

0

Source: https://habr.com/ru/post/1615419/


All Articles