Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authorize new user #4

Closed
traponto opened this issue Feb 25, 2018 · 6 comments
Closed

Authorize new user #4

traponto opened this issue Feb 25, 2018 · 6 comments

Comments

@traponto
Copy link

I'm having trouble activating the authorize procedure inside my WinForm application, it seems that the 'GetToken' function is not invoked and the program goes in loop in the 'Authorize' procedure. I took the same instructions in the sample application 'DiscogsAuthenticationConsole' where instead everything is fine.

@David-Desmaisons
Copy link
Owner

Well, It is very hard to diagnostic anything from what you describe. I would say since DiscogsAuthenticationConsole is working try to simplify your code to make it more and more similar to the sample application till it works.

@FrancisChung
Copy link

Sounds like you need to synchronize your UI thread context.

https://stackoverflow.com/questions/19028374/accessing-ui-controls-in-task-run-with-async-await-on-winforms

@David-Desmaisons
Copy link
Owner

@FrancisChung DiscogsClent is (and needs to be) agnostic in term of application context (WPF, or WinForm or console, or ASP etc...). So it is the caller responsability to make sure that the API is called on the "context" context.

@traponto
Copy link
Author

traponto commented Feb 25, 2018 via email

@traponto
Copy link
Author

Thank you for your answers and for the suggestions you gave me. I took a look at the stackoverflow link (as FrancisChung suggested) and I think I fall into the "deadlock" case described there by "Daniel". I tried to insert the 'Authorize' procedure in a separate thread and I verified that it works. However, I would like to be able to manage the Key (provided by DiscoGS) and tokens (provided by DiscoGSClient) within my WinForm application, so any suggestions to do this are welcome.

@FrancisChung
Copy link

FrancisChung commented Mar 3, 2018

@David-Desmaisons My comments were meant to be directed at Traponto's code, not yours. Apologies for the miscommunication. And you're absolutely right about APIs needing to be context neutral.

@traponto traponto closed this as completed Mar 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants