DolbyIO / dolbyio-rest-apis-client-dotnet

Dolby.io REST APIs Client for .NET
https://www.nuget.org/packages/DolbyIO.Rest
MIT License
2 stars 1 forks source link

415 Unsupported Media Type when requesting client access token from GetClientAccessTokenV2Async #17

Closed eliaspuurunen closed 1 year ago

eliaspuurunen commented 1 year ago

Describe the bug

When requesting a Client Access Token from Communications.Authentication.GetClientAccessTokenV2Async, the request is encoded as Form Data. When calling this method with an access token, the result returned is null.

If I change the encoding in Communications\Authentication.cs to use JsonContent (see sample https://gist.github.com/lenkan/db28050fe8653890ac93e9f2ace7ba03), I receive a client access token.

Expected Behavior

A client access token is returned from the API.

Minimalistic code (recommended)

        var conferenceToken = await this.dolbyClient.Communications.Authentication.GetClientAccessTokenV2Async(
            apiToken,
            new[] {"*"});

Specifications

eliaspuurunen commented 1 year ago

Forked the repo and committed my workaround as a reference.

https://github.com/DolbyIO/dolbyio-rest-apis-client-dotnet/commit/a424b5c75f539175405a7ae080558a2cebd0f4a6

FabienLavocat commented 1 year ago

Thanks a lot again @eliaspuurunen, I did not need to add another extension to send the Json payload as I had a set of extensions already in the project.