locked
(401) unauthorized from websocketclient.connectasync in speechclient.cs RRS feed

  • Question

  • I'm using the stock Speech Translator C# sample from https://github.com/MicrosoftTranslator/SpeechTranslator .

    I've entered my keys from azure correctly.

    speechclient.cs failes at line 147 with await websocketclient.connectasync( clientwsuri,, cancellationtoken)

    clientWsUri {wss://dev.microsofttranslator.com/speech/translate?from=en-US&to=sv&voice=sv-SE-Karin&features=TextToSpeech,Partial&profanity=Strict&flight=experimental&api-version=1.0} System.Uri

    When I trace through various auth tokens look valid but the line below seems to kick up unauth

    Log output - long run is cause I was stepping through it.

    05/16/2017 22:17:07.55 E: Unable to connect: cid='4D530666', elapsedMs='170056'.
    Unable to connect to the remote server
    The remote server returned an error: (401) Unauthorized.

    Thanks...

    serviceurl = +  ServiceUrl {https://api.cognitive.microsoft.com/sts/v1.0/issueToken} System.Uri

    token source has sub id:

    ? tokenSource

    {Microsoft.Translator.API.AzureAuthToken}

    RequestStatusCode: InternalServerError

        SubscriptionKey: "..................389803"

        storedTokenTime: {1/1/0001 12:00:00 AM}

        storedTokenValue: ""

    {Microsoft.MT.Api.TestUtils.SpeechTranslateClientOptions}

        AuthHeaderKey: "Authorization"

        AuthHeaderValue: ""

        ClientAppId: {ea66703d-90a8-436b-9bd6-7a2707a2ad99}

        CorrelationId: "7147E079"

        Experimental: true

        Features: "TextToSpeech,Partial"

        Hostname: "dev.microsofttranslator.com"

        Profanity: "Strict"

        TranslateFrom: "en-US"

        TranslateTo: "sv"

        Voice: "sv-SE-Karin"


    Joe Healy, Tampa, FL

    Wednesday, May 17, 2017 2:38 AM