SpotifyAPI-NET icon indicating copy to clipboard operation
SpotifyAPI-NET copied to clipboard

Initial Auth request timeout

Open sor124248 opened this issue 8 years ago • 2 comments

Hi there,

I'm not sure if this is just that my machine decides to go slow when doing this. I'm not even sure I initiate spotifywebapi correctly, however When running this:

_spotify = await webApiFactory.GetWebApi()

My web browser will open and go to the correct page (eventually) - but sometimes it will timeout after 20 seconds. This is not enough time for my browser to open and retrieve the required token. Can the request timeout be increased to allow more time for the browser to open? How do I do this?

I have a machine with an attitude problem, you see.

Don't get me wrong, after a few attempts I can get it to work. Only by opening the browser manually and then running my app.

The error I get is "No valid response received for the least 20 seconds"

sor124248 avatar Oct 17 '18 11:10 sor124248

When creating an instance of the WebAPIFactory there are the following parameters: WebAPIFactory(string redirectUrl, int listeningPort, string clientId, SpotifyAPI.Web.Enums.Scope scope, TimeSpan timeout, [string xss = "XSS"])

You can set the timeout parameter to something like TimeSpan.FromSeconds(40)

stesto avatar Oct 23 '18 14:10 stesto

This fixed my issue, thank you so much for your quick response

sor124248 avatar Oct 26 '18 13:10 sor124248